在腾讯云中创建轻量级应用服务器默认没有root登录,官方给了lighthouse账号进行webshell登录;但对于日常使用中偏向于root链接,本文记录了全新服务器配置root账号,且使其可远程链接使用。
服务器环境及工具:
CentOS 7.6 64bit
MobaXterm
1. 免密登录lighthouse账号
2. 使用普通账号登录,设置root密码
sudo passwd root
3. 开启root账号密码远程登录
切换登录root
su
修改/etc/ssh/sshd_config
文件
vim /etc/ssh/sshd_config
将PasswordAuthentication
改为yes
,并保存(大概在65行)
重启服务生效
service sshd restart
4. 使用MobaXterm尝试root账号登录
文章来源:https://www.toymoban.com/news/detail-510528.html
OK,可以正常进入。文章来源地址https://www.toymoban.com/news/detail-510528.html
到了这里,关于腾讯云轻量应用服务器开启root远程登录的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!