拽拽
管理员组

用winscp的root连接ubuntu 提示“拒绝访问”的解决方法

ubuntu 服务器默认的root账号是没有激活的,需要用初装的用户账号给root设置管理密码:


user@ubuntu12:~$ sudo passwd root //用sudo修改root帐户

Password: //输入密码

Enter new UNIX password: //提示输入新的root帐户密码

Retype new UNIX password:  //再输入一次确认密码


修改成功之后你就可以使用root账号了,可以使用su root 命令切换到root。

但是碰到过一次情况,就是修改之后,直接用root账号无法登陆远程终端,这是还需要修改ssh配置文件:

/etc/ssh/sshd_config 修改该配置文件:


# Authentication:

LoginGraceTime 120

PermitRootLogin without-password

StrictModes yes


将 PermitRootLogin without-password  修改为 PermitRootLogin yes,如下:


# Authentication:

LoginGraceTime 120

PermitRootLogin yes

StrictModes yes



reboot now 执行重启 重启之后可以成功登陆了。


#1楼
发帖时间:2015-7-25   |   查看数:0   |   回复数:0
游客组