赞
踩
vim /etc/ssh/sshd_config
在文件中 #Port 22 行下增加
# Port 22
Port [修改后端口]`
firewall-cmd --zone=public --add-port=你的端口/tcp --permanent
firewall-cmd --reload
systemctl restart sshd.service
Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.
执行 “journalctl -xe” , 提示没有权限
2月 24 10:15:49 localhost.localdomain sshd[25045]: error: Bind to port 2022 on 0.0.0.0 failed: Permission denied.
2月 24 10:15:49 localhost.localdomain sshd[25045]: error: Bind to port 2022 on :: failed: Permission denied.
2月 24 10:15:49 localhost.localdomain sshd[25045]: fatal: Cannot bind any address.
2月 24 10:15:49 localhost.localdomain systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
2月 24 10:15:49 localhost.localdomain systemd[1]: Failed to start OpenSSH server daemon.
3. 关闭 selinux
执行
setenforce 0
然后执行重置命令
systemctl restart sshd.service
再查看
systemctl status sshd
setenforce 1
telnet 192.168.21.12 2022
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。