当前位置:网站首页>初次使用腾讯云,解决只能使用webshell连接,不能使用ssh连接。
初次使用腾讯云,解决只能使用webshell连接,不能使用ssh连接。
2022-07-05 12:42:00 【No Bug】
Ubuntu 系统如何使用 root 用户登录实例?
Ubuntu 系统的默认用户名是 ubuntu,并在安装过程中默认不设置 root 帐户和密码。您如有需要,可在设置中开启允许 root 用户登录。具体操作步骤如下:
- 使用 ubuntu 帐户登录轻量应用服务器。
- 执行以下命令,设置 root 密码。
sudo passwd root
- 输入 root 的密码,按 Enter。
- 重复输入 root 的密码,按 Enter。
返回如下信息,即表示 root 密码设置成功。passwd: password updated successfully
- 执行以下命令,打开
sshd_config
配置文件。sudo vi /etc/ssh/sshd_config
- 按 i 切换至编辑模式,找到
#Authentication
,将PermitRootLogin
参数修改为yes
。如果PermitRootLogin
参数被注释,请去掉首行的注释符号(#
)。如下图所示: - 找到
#Authentication
,将PasswordAuthentication
参数修改为 yes。如下图所示:说明
若
sshd_config
配置文件中无此配置项,则添加PasswordAuthentication yes
项即可。 - 按 Esc,输入 :wq,保存文件并返回。
- 执行以下命令,重启 ssh 服务。
sudo service ssh restart
- 参考 使用远程登录软件登录 Linux 实例 ,并使用以下信息登录 Ubuntu 轻量应用服务器:
- 用户名:root
- 登录密码:在 步骤2 中已设置的密码
以上是腾讯云的官方文档。这里少强调了一个地方,就是PasswordAuthentication yes,这里默认是(#PasswordAuthentication prohit password)需要去掉注释# 然后改成 PasswordAuthentication yes
这样就可以远程ssh登录了。
边栏推荐
- OPPO小布推出预训练大模型OBERT,晋升KgCLUE榜首
- Actual combat simulation │ JWT login authentication
- RHCSA2
- Transactions on December 23, 2021
- Pinduoduo flag insertion remarks API
- DNS的原理介绍
- Introduction to the principle of DNS
- SAP UI5 DynamicPage 控件介紹
- Taobao flag insertion remarks | logistics delivery interface
- 2021-12-21 transaction record
猜你喜欢
RHCSA1
CVPR 2022 | single step 3D target recognizer based on sparse transformer
Simply take stock reading notes (2/8)
HiEngine:可媲美本地的云原生内存数据库引擎
2021-12-21 transaction record
A few years ago, I outsourced for four years. Qiu Zhao felt that life was like this
Transactions from December 27 to 28, 2021
2021.12.16-2021.12.20 empty four hand transaction records
Pinduoduo flag insertion remarks API
[cloud native] event publishing and subscription in Nacos -- observer mode
随机推荐
MySQL splits strings for conditional queries
Association modeling method in SAP segw transaction code
Laravel document reading notes -mews/captcha use (verification code function)
OPPO小布推出预训练大模型OBERT,晋升KgCLUE榜首
Taobao short videos are automatically released in batches without manual RPA open source
LeetCode20.有效的括号
SAP UI5 DynamicPage 控件介紹
HiEngine:可媲美本地的云原生内存数据库引擎
Actual combat simulation │ JWT login authentication
RHCSA5
跨平台(32bit和64bit)的 printf 格式符 %lld 输出64位的解决方式
Introduction to the principle of DNS
VoneDAO破解组织发展效能难题
Overflow toolbar control in SAP ui5 view
ABAP editor in SAP segw transaction code
CVPR 2022 | single step 3D target recognizer based on sparse transformer
Install rhel8.2 virtual machine
以VMware创新之道,重塑多云产品力
解决 UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa2 in position 107
10 minute fitness method reading notes (5/5)