본문 바로가기
Server

[CentOS] SSH 포트 변경

by 전재훈 2020. 6. 1.
반응형

/etc/ssh/sshd_config 에서 포트 번호를 변경하고 service sshd restart를 하면 아래와 같은 에러 메세지가 발생할 수 있습니다.

 

Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.

 

보안강화로 설치된 리눅스에서는 sshd_config에서 포트만 변경했을 때 데몬 오류를 발생해서 그런데 이럴 경우에는 아래처럼 해주면 됩니다.

 

1. yum install policycoreutils-python

 

2. semanage port -a -t ssh_port_t -p tcp 22110

 

3. systemctl restart sshd 또는 service sshd restart 를 실행

 

4. netstat -anp | grep LISTEN | grep sshd

 

 

반응형

댓글