标题说大部分,但我会更具体:有没有办法通过ssh登录到服务器上scp文件到本地机器上?
当我想从scp
我的本地机文件到服务器,我会用:
[email protected]_hostname:~$ scp local_file.txt [email protected]_server:~/
[email protected]_servers password:
local_file.txt 100% 0 0.0KB/s 00:00
[email protected]_hostname:~$
正如你所看到的,我被提示输入该ssh服务器的密码,并且该文件将被安全地复制。
至此,如果我想从远程SSH服务器复制到我的本地机器的文件时,我一直在使用scp这样的:
[email protected]_hostname:~$ scp [email protected]_server:~/server_file.txt ~/
[email protected]_servers password:
server_file.txt 100% 0 0.0KB/s 00:00
[email protected]_hostname:~$
正如你所看到的,我问再次输入密码。
[email protected]_hostname:~$ ssh [email protected]_server
[email protected]_servers password:
server login success!
[email protected]_server:~$ scp server_file.txt [email protected]_hostname:~/
[email protected]_sercer:~$
这是可能的:如果我已经通过ssh的东西沿着这行登录到服务器这将是很好跳过密码?还是实际?
据我所知,这是不可能直接使用'ssh'和'scp'。您可以使用其他实用程序。一个非常灵活的是'netcat'。看看这个教程:https://nakkaya.com/2009/04/15/using-netcat-for-file-transfers/ – arkascha
或者也许用rsync? – Hackerman