开启ssh服务

1、安装SSH服务,使用命令:sudo apt  install openssh-server

2、查看ssh服务是否启动

qiu@ubuntu:~$ sudo ps -e | grep ssh
   1676 ?        00:00:00 ssh-agent
   5073 ?        00:00:00 sshd  ---表示启动
3、查看服务状态

qiu@ubuntu:~$ sudo service ssh status
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2020-10-13 16:45:00 PDT; 4min 2s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 5073 (sshd)
      Tasks: 1 (limit: 2285)
     Memory: 5.5M
     CGroup: /system.slice/ssh.service
             └─5073 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups

Oct 13 16:45:00 ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Oct 13 16:45:00 ubuntu sshd[5073]: Server listening on 0.0.0.0 port 22.
Oct 13 16:45:00 ubuntu sshd[5073]: Server listening on :: port 22.
Oct 13 16:45:00 ubuntu systemd[1]: Started OpenBSD Secure Shell server.
Oct 13 16:46:57 ubuntu sshd[6094]: Accepted password for qiu from 192.168.220.1 port 57505 ssh2
Oct 13 16:46:57 ubuntu sshd[6094]: pam_unix(sshd:session): session opened for user qiu by (uid=0)
Oct 13 16:46:57 ubuntu sshd[6104]: Accepted password for qiu from 192.168.220.1 port 57507 ssh2
Oct 13 16:46:57 ubuntu sshd[6104]: pam_unix(sshd:session): session opened for user qiu by (uid=0)
qiu@ubuntu:~$

 

4、启动ssh服务

sudo /etc/init.d/ssh start

你可能感兴趣的:(linux)