码迷,mamicode.com
首页 > 系统相关 > 详细

【转】ubuntu下允许root用户ssh远程登录

时间:2015-10-08 01:41:38      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:

原文链接 http://blog.sina.com.cn/s/blog_7e64a87b0100rn8w.html

 

SSH服务器,可以通过SSH协议来访问远程服务器,代替telnet和ftp。

但是ubuntu默认是不启用root用户也不允许root远程登录的。所以需要先启用root用户

启用root用户:sudo passwd root      //修改密码后就启用了

安装OpenSSH server:

1. 使用apt命令安装openssh server

$ sudo apt-get install openssh-server

 

2. 可以对 openssh server进行配置

$ sudo vi /etc/ssh/sshd_config

找到PermitRootLogin no一行,改为PermitRootLogin yes

 

3. 重启 openssh server

$ sudo service ssh restart

 

4. 客户端如果是ubuntu的话,则已经安装好ssh client,可以用下面的命令连接远程服务器。

$ ssh xxx.xxx.xxx.xxx

如果是windows系统的话,可以使用SSH Secure Shell等ssh软件进行远程连接。

 

spark@liuhy:~$ sudo vi /etc/ssh/sshd_config 

# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes


spark@liuhy:~$ sudo service ssh restart 
ssh stop/waiting
ssh start/running, process 2977
spark@liuhy:~$ 


spark@liuhy:~$ ssh root@192.168.1.112
The authenticity of host 192.168.1.112 (192.168.1.112) cant be established.
ECDSA key fingerprint is 7c:46:fb:7f:50:fc:66:45:90:20:80:6a:04:76:0b:0a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 192.168.1.112 (ECDSA) to the list of known hosts.
root@192.168.1.112s password: 

 

【转】ubuntu下允许root用户ssh远程登录

标签:

原文地址:http://www.cnblogs.com/ihongyan/p/4859910.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!