欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ubuntu安装ssh服务并开启root用户远程登录

程序员文章站 2022-06-05 17:23:09
...

先安装openssh-server服务,配置开启root登录,给服务器root设置下密码,使用ssh [email protected]远程登录即可,windows下也可使用putty,xshell进行ssh登录

sudo apt install openssh-server #安装 ssh-server 服务
ps -ef|grep ssh #查看服务是否正常启动
sudo service sshd start #启动 ssh 服务
vim /etc/sshd/sshd_config #在 sshd 文件中添加 PermitRootLogin yes
service sshd restart #重启ssh服务
sudo passwd root #设置服务器 root 密码
ssh [email protected] #使用 root 用户进行远程登录
相关标签: 杂记 ssh linux