设置新root账户密码
Ubuntu服务器默认的root账号是没有激活的 , 需要用初装的用户账号给root设置管理密码 , 如下所示 :
$ sudo passwd root // 用sudo修改root帐户密码
Password: // 输入密码
Enter new UNIX password: // 输入新的root帐户密码
Retype new UNIX password: // 确认密码
使用Xshell连接登录
先在要连接的Ubuntu主机下开启SSH服务 , 如果没有开启需要安装openssh-server :
sudo apt-get install openssh-server
使用ps -e | grep ssh , 如果只有ssh-agent表示还没启动 , 需要/etc/init.d/ssh start ;
有sshd说明已启动 , 还是不行直接reboot
以上完成后打开Xshell , ,选择 “新建”->”连接”设置里选择SSH , 主机填入需要连接的主机的IP地址 , 在”用户身份验证”中填入可用的登录Ubuntu的用户名和密码即可
使用Winscp以root身份登录
修改配置文件 :
vim /etc/ssh/sshd_config
# Authentication:
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes
将 PermitRootLogin without-password 修改为 PermitRootLogin yes , 如下所示 :
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
个人网站: Github , 欢迎点击给星