環(huán)境:
Centos 7.5
VMware 16.0.0
問題描述:
CentOS7.5 修改默認(rèn)ssh端口號,重啟sshd失敗如何解決
重啟sshd時 :

解決方案:
1.關(guān)閉setenforce
setenforce 0
設(shè)置永久關(guān)閉selinux
vim /etc/sysconfig/selinux
將第7行內(nèi)容修改如下
SELINUX=disabled
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2.啟動sshd服務(wù)
systemctl start sshd
3.查看sshd服務(wù)狀態(tài)
systemctl status sshd

4.防火墻開放sshd端口
firewall-cmd --zone=public --add-port=2023/tcp --permanent
firewall-cmd --reload
systemctl restart sshd
版權(quán)聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻(xiàn),該文觀點僅代表作者本人。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如發(fā)現(xiàn)本站有涉嫌抄襲侵權(quán)/違法違規(guī)的內(nèi)容, 請發(fā)送郵件至2705686032@qq.com 舉報,一經(jīng)查實,本站將立刻刪除。原文轉(zhuǎn)載: 原文出處: