---
title: "SSH 直接用Root连接ubuntu"
author: "phipray"
date: "2016-10-02T17:57:25Z"
tags: []
categories: ["操作系统"]
slug: "ssh-root-ubuntu"
draft: false
lastmod: "2016-10-02T17:57:25Z"
id: 2328194
url: "https://phipray.iteye.com/blog/2328194"
---

设置root账号的密码

$ sudo passwd root

 输入你当前用户的密码

 输入你希望的root用户的密码

 确认密码

修改ssh的配置

$ sudo vi /etc/ssh/sshd\_config

找到PermitRootLogin no一行，改为PermitRootLogin yes

 

重启ssh

$ sudo service ssh restart