Ubuntu Server 14.04 下root无法ssh登陆

本文介绍了如何在Ubuntu系统中配置SSH服务以允许root用户登录,并提供了两种获取root权限的方法。一种是设置root用户的密码并通过su命令切换到root角色;另一种是在普通用户下使用sudo su命令临时获得root权限。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#vim /etc/ssh/sshd_config

# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password    #找到这里,把它注释
PermitRootLogin yes                  #改为yes  然后重启ssh
StrictModes yes

 #service ssh restart



/etc/init.d/ssh restart

 

获取root权限

方法一:

1. set a password for root:   sudo passwd root

2. using command to get root role: su

3. enter the root's password set in step 1

 方法二:

1. login ubuntu with customer account

2. run command: sudo su

3. enter customer account's password

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值