ubuntu22.04启用sshd远程

1. 系统升级

ubuntu有一个很麻烦的特性,就是新装的系统需要先更新系统:

sudo apt-get update -y

2. 安装openssh-server【sshd】

sudo apt install openssh-server

 

3. 开放防火墙

sudo ufw allow ssh

4. 允许root远程

sudo su -

 passwd root

echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config

5. 启服务,检查服务状态

sudo systemctl restart sshd

sudo systemctl status ssh

 

posted @ 2023-01-03 18:58  咿呀哒喏  阅读(1414)  评论(0编辑  收藏  举报