腾讯云服务器Ubuntu镜像使用Xshell控制
使用Ubuntu创建的镜像一半默认禁用root用户名通过密码方式访问,需开启后才可以
使用root用户登录实例
-
登录云服务器页面,使用一键登录进入服务器命令行界面
-
设置root密码
sudo passwd root
输入密码,按enter
再次输入密码,按enter
如果出现passwd: password updated successfully
则说明成功 -
执行该命令,修改配置文件
sudo vi /etc/ssh/sshd_config
点击i切换至编辑模式,找到#Authentication
,修改PermitRootLogin
和PasswordAuthentication
参数
这两个参数如果前面有#,则去除#;如果没有,则添加
PermitRootLogin yes
PasswordAuthentication yes
点击esc,输入:wq,点击Enter -
执行该命令,重启ssh服务
sudo service ssh restart