1.安装
sudo apt-get install openssh-server
2.启动与停止
/etc/init.d/ssh start //启动
/etc/init.d/ssh stop //停止
/etc/init.d/ssh restart //重启
3.使用
串口工具xshell(其他也可以),新建ssh连接,第一次会提醒输入账号和密码,打开如下:
Copyright (c) 2002 NetSarang Computer, Inc. All rights reserved.
Type `help' to learn how to use Xshell prompt.
[C:\~]$
Connecting to 192.168.74.128:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 5.3.0-46-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
104 packages can be updated.
63 updates are security updates.
Your Hardware Enablement Stack (HWE) is supported until April 2023.
Last login: Mon Aug 31 16:12:47 2020 from 192.168.74.1
rick@ubuntu:~$
/etc/init.d/ssh restart
4.其他使用举例:
scp -P 4588 remote@xxx.xxx.xxx:/usr/local/sin.sh /home/administrator //xx为IP