使用 ssh 移动文件

top*_*ess 4 ssh files

我知道我可以使用 scp 从我的计算机复制文件。有没有办法一次移动它们而不是用 ssh 复制?

Oli*_*Oli 7

一种方法是使用sshfs. 它相当快,相当干净,不需要 root 即可操作。有一些设置要做(这些天实际上可能是可选的),但您可以在其帮助页面上阅读相关内容。

但这是我将媒体中心的家安装在本地家的子目录中的方式:

oli@bert:~$ mkdir tim # create a directory to mount on
oli@bert:~$ sshfs oli@tim:/home/oli tim
oli@bert:~$ ls tim
alsa-info.sh  kernelbuild  key  NVIDIA-Linux-x86-270.26.run  uberboxee
Run Code Online (Sandbox Code Playgroud)

一旦到了那个时候,远程文件系统和本地文件系统就会合而为一。您可以根据需要将内容移动到已安装的卷中。完成后,只需开火fusermount -u the_dir_you_mounted_on

oli@bert:~$ fusermount -u tim
oli@bert:~$ ls tim
oli@bert:~$ # there's nothing there because there's nothing mounted on it
Run Code Online (Sandbox Code Playgroud)