---
title: "Ubuntu Server 14.04 下root无法ssh登陆"
author: "codyJava"
date: "2015-08-31T15:10:32Z"
tags: []
categories: ["操作系统"]
slug: "ubuntu-server-14-04-root-ssh"
draft: false
lastmod: "2016-04-07T14:53:26Z"
id: 2239555
url: "https://codyjava.iteye.com/blog/2239555"
---

#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
```