Linux - ubuntu 16 打开SSH服务

时间:2022-09-01 20:08:15

ubuntu 16 打开SSH服务

1.查看是否启动进程

roott@jiqing-virtual-machine:~# ps -ef | grep sshd
root 3477 1 0 18:36 ? 00:00:00 /usr/sbin/sshd -D
root 3478 3477 0 18:36 ? 00:00:00 sshd: root@pts/1
root 3552 2265 0 18:37 pts/3 00:00:00 grep --color=auto sshd

2.如果没有,安装ssh-server

apt-get install openssh-server

3.启动ssh

/etc/init.d/ssh start

4.开启root登录

sudo vi /etc/ssh/sshd_config
PermitRootLogin yes

5.自动接受新的公钥

sudo vi /etc/ssh/ssh_config
StrictHostKeyChecking no

7.重新启动

/etc/init.d/ssh restart

sudo service ssh restart