Infra/Linux
[Solved][Centos7] Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.
Tradgineer
2020. 2. 4. 15:30
[ 문제 상황 ]
변경된 sshd_config 파일의 설정 내용을 적용시키기 위해 시도한 sshd.service 재시작 실패
systemctl restart sshd
[ ERROR 문구 예시 ]
Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.
[ 문제 원인 ]
selinux가 active 되어있어 발생
[ 해결 방법 ]
1. selinux Permissive로 전환
- setenforce를 통해 Permissive로 변경
- getenforce를 통해 selinux permissive 적용 확인
setenforce 0
getenforce
2. selinux를 disabled로 설정 변경
[ 주의할 점 ]
sshd port 변경 후 방화벽을 확인하여 해당 포트가 open되어있는지 확인 필요!