SSH安装
# 安装 SSH ,默认启动apt install openssh-server -y# 启动 ssh/etc/init.d/ssh start# 重启 ssh/etc/init.d/ssh restart# 查看 ssh 状态/etc/init.d/ssh status# 关闭 ssh/etc/init.d/ssh stop
修改用户密码,例如root
sudo passwd root
允许用户使用root账户远程连接
# 开启远程连接
vim /etc/ssh/sshd_config
# 找到 #PasswordAuthentication yes 把#的注释去掉
PasswordAuthentication yes
# 将 #PermitRootLogin prohibit-password 修改为:PermitRootLogin yes
PermitRootLogin yes
# 重启 SSH 服务
/etc/init.d/ssh start
# 设置开机自启
update-rc.d ssh enable
