sudo apt-get install openssh-server
ps -e|grep ssh
sudo /etc/init.d/ssh start
sudo service ssh start sudo service ssh status
如果ssh运行会打印如下类似信息:
● ssh.service - OpenBSD Secure Shell server Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2019-06-17 17:17:04 CST; 20h ago Process: 403 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS) Main PID: 439 (sshd) CGroup: /system.slice/ssh.service └─439 /usr/sbin/sshd -D Jun 18 13:37:50 raspberrypi sshd[21733]: Accepted password for pi from 192.168.169.151 port 2805 ssh2 Jun 18 13:37:50 raspberrypi sshd[21733]: pam_unix(sshd:session): session opened for user pi by (uid=0) Jun 18 14:09:45 raspberrypi sshd[30043]: Accepted password for pi from 192.168.169.151 port 10399 ssh2 Jun 18 14:09:45 raspberrypi sshd[30043]: pam_unix(sshd:session): session opened for user pi by (uid=0) Jun 18 14:13:16 raspberrypi sshd[31028]: Accepted password for pi from 192.168.169.203 port 52093 ssh2 Jun 18 14:13:16 raspberrypi sshd[31028]: pam_unix(sshd:session): session opened for user pi by (uid=0) Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
在终端命令行中启动SSH服务后,如果系统重启或关机后启动,SSH服务默认是关闭的,依然需要手动启动,为了方便可以设置SSH服务开机自动启动,打开 /etc/rc.local 文件,在语句 exit 0 之前加入:
/etc/init.d/ssh start
SSH
文件,开启SSH.原文:https://www.cnblogs.com/Java-Script/p/11096042.html