1、查看是否开启ssh服务:
sudo ps -e | grep ssh
2、查看是否安装了ssh服务:
sudo service ssh start
若没有安装,终端打印以下信息:
:~$ sudo service ssh start
Failed to start ssh.service: Unit ssh.service not found.
3、安装ssh服务:
sudo apt-get install openssh-server
4、开启、关闭及运行状态查询
service ssh start/stop/status
5、ssh登录远端 ssh 用户名@IP -p portid
:~$ ssh nvidia@192.168.1.66 -p 22
The authenticity of host '192.168.1.66 (192.168.1.66)' can't be established.
ECDSA key fingerprint is SHA256:oTgKigtyuJgE0GInUM9EkZObS6bfjvfr2ENHU7j+1wE.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.66' (ECDSA) to the list of known hosts.
nvidia@192.168.1.66's password:
Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.38-tegra aarch64)
* Documentation: https://help.ubuntu.com/
628 packages can be updated.
314 updates are security updates.
Last login: Sat Apr 28 05:41:40 2018
nvidia@tegra-ubuntu:~$ exit
logout
Connection to 192.168.1.66 closed.
6、ssh复制文件scp
本地->远端(复制文件):
scp LocalFile UserName@RemoteIP:RemoteFile
本地->远端(复制目录):
scp -r LocalFolder UserName@RemoteIP:RemoteFolder
远端->本地(复制文件):
scp UserName@RemoteIP:RemoteFile LocalFile
远端->本地(复制目录):
scp -r UserName@RemoteIP:RemoteFolder LocalFolder
远端->远端(复制文件,从1复制到2) :
scp UserName1@RemoteIP1:RemoteFile1 UserName2@RemoteIP2:RemoteFile2
远端->远端(复制目录,从1复制到2):
scp -r UserName1@RemoteIP1:RemoteFolder1 UserName2@RemoteIP2:RemoteFolder2
:/media/.../新加卷/Document/Sensor/Tx2$ \
scp LKT4303txt-Download.tar.gz nvidia@192.168.1.66:/home/nvidia/lkt4303/LKT4303txt-Download.tar.gz
nvidia@192.168.1.66's password:
LKT4303txt-Download.tar.gz 100% 15KB 14.7KB/s 00:00
:/media/.../新加卷/Document/Sensor/Tx2$