HELLOCBT

Menu

리눅스 SSH 설정 포트변경

 

 

CentOS 기준 SSH 설정위치는 /etc/ssh/sshd_config 에서 확인 가능합니다.

 

-> [root@localhost ~]# vi /etc/ssh/sshd_config 입력후 화면

 

# $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

 

 

SSH 서비스 포트는 22로 규악되어 있습니다. 하지만 보안을 위해 포트를 변경해주는것도 가능합니다.

#주석을 지우고 원하는 포트로 변경하시면 됩니다. 

 

포트변경 후 sshd 재시작 명령어 입력

-> [root@localhost ~]# systemctl restart sshd

 

포트가 정상적으로 올라와있는지 확인

-> [root@localhost ~]# netstat -nlpt

 

댓글 0

사진 및 파일 첨부

파일 용량 제한 : 0MB (허용 확장자 : *.*)

0개 첨부 됨 ( / )
 
번호 제목 글쓴이 날짜 조회 수
18 ip 접근회수 ㅇㅇ 2020.11.16 63
17 아파치 2.4 컴코리아 2020.08.14 85
16 centos에 Ioncube 설치하기 컴코리아 2020.08.06 84
15 PHP5 버젼 컴코리아 2020.08.05 304
14 APM 버전 확인 컴코리아 2020.07.17 81
13 APM설치 mysql [1] 컴코리아 2020.07.09 60
12 APM설치 Aphache 컴코리아 2020.07.09 75
11 윈도우(Window) 윈도우 바로가기 ncpa.cpl 명령어 컴코리아 2020.04.17 198
10 윈도우(Window) R1Soft Backup Agent file 컴코리아 2020.04.17 78
9 리눅스(linux) vi 에디터 사용방법 (vim 단축키 정리) 컴코리아 2020.04.13 51
8 리눅스(linux) 디스크 용량 명령어 df,du file 컴코리아 2020.04.13 56
7 리눅스(linux) Screen 명령어 file 컴코리아 2020.04.12 63
6 리눅스(linux) iptables 특정 아이피만 특정포트 접속 file 컴코리아 2020.04.11 79
5 리눅스(linux) iptables 명령어 file 컴코리아 2020.04.11 80
4 리눅스(linux) CPU 및 RAM 사양 확인 file 컴코리아 2020.04.11 98
» 리눅스(linux) SSH 설정 포트변경 - /etc/ssh/sshd_config [CentOS] 컴코리아 2020.04.11 136
2 리눅스(linux) shutdown 그리고 init 명령어 컴코리아 2020.04.11 100
1 리눅스(linux) PS 명령어 file 컴코리아 2020.04.11 95

HELLOCBT