CentOS远程SSH登录

title

1. 禁止ROOT远程SSH登录

# vi /etc/ssh/sshd_config

修改

PermitRootLogin yes

PermitRootLogin no

然后,重启sshd服务

# systemctl restart sshd

远程管理用普通用户登录,然后用su root切换到root

2. 修改SSH默认端口

# vi /etc/ssh/sshd_config

修改

port 51822

然后,重启sshd服务

# systemctl restart sshd

3. 指定端口SSH登录

# ssh user@192.168.1.1 -p 51822
powered by Gitbook© 2023 编外计划 | 最后修改: 2023-11-24 03:37:01

results matching ""

    No results matching ""