sudo -i
vi /etc/ssh/sshd_config
# 默认为no,需要root用户登陆改为yes
PermitRootLogin yes
# 默认为no,需要root用户密码登陆改为yes
PasswordAuthentication yes
passwd root
# 输入两遍新密码
# Centos7
systemctl restart sshd.service
# Ubuntu
sudo service ssh restart
# CentOS
# 查看服务
systemctl status sshd.service
# 启动服务
systemctl start sshd.service
# 关闭服务
systemctl stop sshd.service
# 重启服务
systemctl restart sshd.service
# 开机自启
systemctl enable sshd.service
# Ubuntu
# 查看服务
sudo service ssh status
# 启动服务
sudo service ssh start
# 关闭服务
sudo service ssh stop
# 重启服务
sudo service ssh restart
文章评论