얕고넓은지식/linux

centos 7 ssh 설치중 이런 오류가 뜬다면? Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.

쪽마 2021. 3. 23. 00:56
반응형

centos 7 ssh 설치중 이런 오류가 뜬다면? Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.

 

[root@localhost ~]# firewall-cmd --permanent --zone=public --add-port=1234/tcp


[root@localhost ~]# firewall-cmd --reload

 

[root@localhost ~]# vi sshd_config

#Port 22

Port 1234

# PermitRootLogin yes  root ssh 접속금지하는거

PermitRootLogin no

 

 

[root@localhost ~]# systemctl restart sshd

 

어? 근데 아래와같은 오류가난다

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

 

해결책아래와같이 실행

[root@localhost ~]# yum install policycoreutils-python

[root@localhost ~]# semanage port -l | grep ssh

[root@localhost ~]# semanage port -a -t ssh_port_t -p tcp 1981

[root@localhost ~]# semanage port -l | grep ssh

[root@localhost ~]# firewall-cmd --reload

[root@localhost ~]# systemctl start sshd

[root@localhost ~]# systemctl status sshd

 

 

이렇게뜨면 합격

 

 

 

 

 

반응형