메뉴 건너뛰기

리눅스 관련 모음

본문시작

설치관련
2013.06.25 07:23

ssh 포트변경 및 iptables 수정

조회 수 16639 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

국산 통나무 수공예 남원제기, 남원목기

자료가 도움이 되셨다면
혼수용품제수용품 필요시
남원제기 공식 홈페이지 http://남원제기.kr
남원목기 공식 홈페이지 http://otchil.kr
에서 구매 해 주세요
정성껏 모시겠습니다.
 

원격에서 수정하면 ssh 연결이 끊길 수 있으니 주의하기 바란다.

서버 콘솔에서 하는게 정신 건강에 좋을 것 같다.


1. 첫번째


/etc/sysconfig/iptables 파일 수정

이미 ssh를 사용하고 있다면

#>vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT 를 앞에 #을 붙여 주석 처리하고

#-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT  복사하여 22포트 대신 사용하고자 하는 포트번호로 변경.

-A INPUT -m state --state NEW -m tcp -p tcp --dport 2121 -j ACCEPT

수정 후

#> service iptables save

#> service iptablesrestart


만약 ssh 22번 포트 개방에 대한 문구가 없다면 다음과 같이 넣어 주면 된다.INPUT -p TCP --dport xx -m state --state NEW -j ACCEPT

-A INPUT -p TCP --dport xx -m state --state NEW -j 

#> iptables -D INPUT -p -dport 2121 -m state --state NEW -j ACCEPT

#> service iptables save

#> service iptablesrestart



2. 두번째 작업


/etc/ssh 에 아래 두개의 설정 파일이 있는데 이것을 편집기로 열어 수정 해 준다.


ssh_config 파일 : 클라이언트 툴의 접근에 대한 설정을 하는 파일(사용자를 위한 파일)
sshd_config 파일 : ssh 데몬 설정을 위한 설정 파일이다.(서버용)


#> vi /etc/ssh/ssh_config

port 2121


#> vi /etc/ssh/sshd_config

port 2121


#>service sshd restart


포트가 열려있는지 확인
# netstat -na|grep :2121


*****  이제 ssh를 연결하면 포트 22번이 아니라 포트 2121번으로 연결 될 것이다.



3. 세번째 작업


만약 여러분이 공유기를 사용하여 포트포워딩을 한다면 공유기의

dmz 포트 포워딩 포트번호도 변경 해 줘야 한다는 사실 잊지 마세요.





   

  1. httpd-2.4.4 httpd.conf 설정 옵션 변경.

    Date2013.06.13 Category설치관련 By햇빛소년 Views15146
    Read More
  2. procmail 소스설치

    Date2013.07.24 Category설치관련 By햇빛소년 Views16007
    Read More
  3. The ClamAV Plugin --> clamav.cf , clamav.pm

    Date2013.07.07 Category설치관련 By햇빛소년 Views16181
    Read More
  4. rewrite 도메인 포워딩

    Date2013.06.22 Category설치관련 By햇빛소년 Views16344
    Read More
  5. ssh 포트변경 및 iptables 수정

    Date2013.06.25 Category설치관련 By햇빛소년 Views16639
    Read More
  6. rsync 를 이용한 원격 서버 백업하기.

    Date2013.07.01 Category에러해결 By햇빛소년 Views16805
    Read More
  7. sendmail[8569]: auxpropfunc error invalid parameter supplied

    Date2013.07.11 Category에러해결 By햇빛소년 Views16962
    Read More
  8. rsync 백업 설정이 확실하게 되었는데도 백업이 되지 않는 다면.....

    Date2013.06.30 Category에러해결 By햇빛소년 Views17190
    Read More
  9. spamassassin 에러 Can't locate Mail/SpamAssassin/CompiledRegexps/body 0.pm in @INC

    Date2013.06.24 Category에러해결 By햇빛소년 Views17281
    Read More
  10. php.ini설정 에러 모음.

    Date2013.06.18 Category에러해결 By햇빛소년 Views17429
    Read More
  11. error: wrong mysql library version or lib not found.

    Date2014.03.16 Category에러해결 By햇빛소년 Views17942
    Read More
  12. [bind] DNSSEC 구축방법

    Date2013.07.07 Category설치관련 By햇빛소년 Views17965
    Read More
  13. [sendmail: clamav-milter error] Milter: data, reject=451 4.3.2 Please try again later

    Date2013.06.27 Category에러해결 By햇빛소년 Views18220
    Read More
  14. rndc-confgen — rndc key generation tool

    Date2013.05.31 Category설치관련 By햇빛소년 Views18700
    Read More
  15. TIFF 설피시 /usr/local/include/jmorecfg.h:263:16: error: expected identifier before numeric constant 에러

    Date2013.06.04 Category에러해결 By햇빛소년 Views18788
    Read More
  16. [MySQL] Incorrect integer value: '' for column '컬럼명' 오류 발생시

    Date2013.06.19 Category에러해결 By햇빛소년 Views18820
    Read More
  17. mc(미드나잇 커맨드) 종료시 처음 PWD로 바뀌는 문제 해결

    Date2013.06.09 Category에러해결 By햇빛소년 Views18940
    Read More
  18. php-5.4.16 컴파일시 checking for db4 major version... Header contains different version 에러

    Date2013.06.18 Category에러해결 By햇빛소년 Views20419
    Read More
  19. dovecot 설치 후 squirrelmail 가동하면 /.imap/INBOX, group=12(mail)) failed: Operation not permitted

    Date2013.06.30 Category에러해결 By햇빛소년 Views20560
    Read More
  20. Sendmail 스패머 IP 차단 쉘스크립트 v2

    Date2012.12.06 By햇빛소년 Views20958
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 Next
/ 10