首先确保你ubuntu上已经安装ssh服务端并且启动。
如果没有安装,需要安装
sudo apt-get install openssh-server
ssh服务启动:
sudo /etc/init.d/ssh start
ssh停止服务:
sudo /etc/init.d/ssh stop
ssh重启服务:
sudo /etc/init.d/ssh restart
配置root用户通过ssh访问
1 修改root在ssh访问的限制:修改/etc/ssh/sshd_config:注解掉#PermitRootLogin without-password
# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
StrictModes yes
2 重启ssh服务
3 通过ssh,用root用户访问此ubuntu,根据提示输入密码即可
ssh root@xxx.xxx.xxx.xxx