linux 修改网卡报错xe,centos修改端口出现Failed to start OpenSSH server daemon 启动报错和-xe报错的解决方法...
修改SSH端口:
#?vi?/etc/ssh/sshd_config
里面找port?22,在前面加上#,去掉注釋,然后把22改成你想要的端口。
#port?22
建議去掉注釋之前,先增加你需要的端口,比如:12345端口,生效后在刪除22端口,以防止修改后,操作錯誤進不去系統。
Port 22
Port 12345
在防火墻中添加改SSH端口。
然后重啟sshd服務 ,命令如下:
查看狀態:
systemctl status sshd.service
啟動服務:
systemctl start sshd.service
重啟服務:
systemctl restart sshd.service
開機自啟:
systemctl enable sshd.service
一、如果執行重啟命令后提示 -xe 報錯:
Job?for?sshd.service?failed?because?the?control?process?exited?with?error?code.?See?"systemctl?status?sshd.service"?and?"journalctl?-xe"?for?details.
然后在執行
#?systemctl?status?sshd.service
得到的反饋:
●?sshd.service?-?OpenSSH?server?daemon
Loaded:?loaded?(/usr/lib/systemd/system/sshd.service;?enabled;?vendor?preset:?enabled)
Active:?activating?(auto-restart)?(Result:?exit-code)?since?Sun?2019-12-08?08:08:31?EST;?26s?ago
Docs:?man:sshd(8)
man:sshd_config(5)
Process:?18904?ExecStart=/usr/sbin/sshd?-D?$OPTIONS?(code=exited,?status=255)
Main?PID:?18904?(code=exited,?status=255)
Dec?08?08:08:31?DC6200-17?systemd[1]:?sshd.service:?main?process?exited,?code=exited,?status=255/n/a
Dec?08?08:08:31?DC6200-17?systemd[1]:?Failed?to?start?OpenSSH?server?daemon.
Dec?08?08:08:31?DC6200-17?systemd[1]:?Unit?sshd.service?entered?failed?state.
Dec?08?08:08:31?DC6200-17?systemd[1]:?sshd.service?failed.
二、如上可見: Failed?to?start?OpenSSH?server?daemon 紅色報錯。
然后在執行: #?journalctl?-xe 執行后,會出現一堆沒用的提示。
最后在執行:
#setenforce?0
即,關閉selinux,然后,一切正常。
最后執行重啟命令:
#?systemctl?restart?sshd.service
自此大工告成。
原創文章,作者:kinpo, k,如若轉載,請注明出處:https://www.yidc.net/archives/70
總結
以上是生活随笔為你收集整理的linux 修改网卡报错xe,centos修改端口出现Failed to start OpenSSH server daemon 启动报错和-xe报错的解决方法...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: scp linux 自动化,expect
- 下一篇: java导致native非法指令,Jav