Ubuntu 18.04 新系统 允许root远程登录设置方法


1. 查看ssh服务器是否安装并启动

#sudo ps -e | grep ssh

1. 安装ssh服务器

  #sudo apt-get install openssh-server

2. 配置sshd文件

编辑SSH服务的配置文件sshd_config,修改SSH的端口和root用户权限。

使用到的命令:(按字母“i”进入编辑模式,按ESC退出编辑模式,“:wq”保存退出)。

root@dante:~# vim /etc/ssh/sshd_config

1、找到# port 22所在的那一行,复制该行内容并修改。

将“#port 22”修改为“port 22”(将前面的“#”去掉)。

该行内容为设置SSHd服务的端口号

2、找到#PermitRootLogin prohibit-password那一行,复制该行内容并修改。

将“#PermitRootLogin prohibit-password”修改为“PermitRootLogin yes”

3. 重启服务器 service ssh restart

service ssh restart

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM