标签: scp

我们如何将 zip 文件 scp 到另一台服务器并将其解压缩到目标服务器上

我需要将 .zip 文件 scp 到另一台服务器,然后将其解压缩到目标服务器上。我怎样才能在Linux中做到这一点

linux scp zip

2
推荐指数
1
解决办法
3万
查看次数

如何通过SCP从远程系统传输文件的一部分?

我正在尝试获取一个重复更新的日志文件。我想要更新的文件,但不想通过 SCP 从远程系统一次又一次地下载整个文件。

有什么想法可以以最少的网络使用量实现这一目标吗?

scp download synchronization files

2
推荐指数
1
解决办法
900
查看次数

从 macOS 终端通过 SSH 将文件上传到 Apache 服务器

我以前从未使用过 Unix shell,我正在努力学习。目前,我被困在一个非常基本的命令中,无法将文件上传到 Apache (OpenSSH) 服务器。几天来我一直在寻找答案,但我找不到解决我遇到的这个特定问题的方法。

我使用 macOS 终端登录到服务器,然后使用此命令将文件从桌面上传到服务器中的目录:

scp /Users/carlos/Desktop/test.html username@server:/home/username/server/wp-content/themes/
Run Code Online (Sandbox Code Playgroud)

我收到一条错误消息,告诉我 test.html 文件不存在:

/Users/carlos/Desktop/test.html: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我知道文件存在并且路径正确(我将文件拖放到终端窗口中以确保)。我也可以使用相同的路径在 VIM 上打开文件,所以它就在那里。

我不明白为什么我会收到这个错误。

有人可以指出我解决这个问题的正确方向吗?提前致谢

ssh scp terminal

2
推荐指数
1
解决办法
9213
查看次数

scp 不起作用。查找原因

我正在尝试将文件 (*.crt) 从本地复制到远程服务器。不幸的是,我无权sshd_config在远程服务器上打开文件。我们团队中有人为我配置了 ssh 代理;我不确定他把这个脚本放在哪里,但我可以毫无问题地连接到这个远程服务器。以下是以下命令的输出:scp -vvv /cygdrive/c/Users/myaccount/Downloads/certs/*.crt user@server:/tmp

>$ scp -vvv /cygdrive/c/Users/myaccount/Downloads/certs/*.crt user@server:/tmp
Executing: program /usr/bin/ssh host server, user user, command scp -v -d -t /tmp
OpenSSH_7.5p1, OpenSSL 1.0.2k  26 Jan 2017
debug2: resolving "server" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to server [124.67.80.20] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/myaccount/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/myaccount/.ssh/id_rsa-cert type -1 …
Run Code Online (Sandbox Code Playgroud)

scp remote

2
推荐指数
1
解决办法
1万
查看次数

如何检查远程路径是目录还是文件?

我正在寻找一种简短的简单方法来检查远程路径是否指向目录(或符号链接目录)或可读文件。

如果它是一个目录,那么我可以scp从该目录中的多个特定文件到我的本地系统,而如果它是一个文件,我只能使用scp该文件。

我有以 - 方式给出的文件路径scpuser@host:/path/to/dir-or-file.

注意:在本地系统(Windows 上的 MobaXterm)上,我有bashscp并且ssh可用,而远程系统(我要检查的路径所在的路径)是完整的 Linux 发行版。

ls ssh scp remote directory

2
推荐指数
1
解决办法
4325
查看次数

为什么 scp 似乎失败了?

副本似乎失败了。我实际上是在尝试复制一个大目录并假设它因为大小而失败,所以我用一个小文件做了一个简单的例子来演示。

hduser@hnode0:~ $ ls -la myfile
-rw-r--r-- 1 hduser hdgroup 0 Aug  7 09:42 myfile
hduser@hnode0:~ $ scp myfile hduser@hnode2
hduser@hnode0:~ $ ssh hnode2
hduser@hnode2:~ $ ls -la myfile
ls: cannot access 'myfile': No such file or directory
hduser@hnode2:~ $ sudo find / -iname myfile
[sudo] password for hduser:
hduser@hnode2:~ $
Run Code Online (Sandbox Code Playgroud)

scp 是否写入日志?

ssh scp debian raspbian

2
推荐指数
1
解决办法
55
查看次数

无法使用 scp 传输文件

我认为自己对此还是很陌生,所以我会尽力解释我遇到的麻烦。我正在尝试将文件发送scp到远程服务器,但我得到Permission denied (publickey). 当我使用详细 ( -v)运行命令时,直到最后我都找不到任何错误。目标目录是我用于 scp 的用户的 rwx。帮助!

legoman@legoman-desktop:~$ sudo scp -v /home/legoman/Documents/index.html legoman@ip:/home/legoman/Documents
Executing: program /usr/bin/ssh host ip, user legoman, command scp -v -t /home/legoman/Documents
OpenSSH_8.3p1 Ubuntu-1ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to ip [ip] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file …
Run Code Online (Sandbox Code Playgroud)

scp

2
推荐指数
1
解决办法
89
查看次数

如何在独立于TTY的其他Linux服务器上复制大文件

实际上我试图复制另一个导演中的所有文件。文件的总大小为 188GB,因此需要一些时间。

我正在尝试使用此命令将 Linux 服务器 A 复制到 B

nohup scp Files-from-Server-A root@xxx.xxx.xxx.xxx:tmp &
Run Code Online (Sandbox Code Playgroud)

但是一旦我关闭终端,它就会停止复制文件,但进程仍然显示在进程管理器中。

scp rhel

1
推荐指数
1
解决办法
2281
查看次数

如何只复制文件夹的文件(包括子文件夹的文件),而不是shell中的文件夹本身

在 Openssh 中,在客户端,必须将 path/to/file 的内容复制到 Server。必须将客户端上 /path/to/file 中的所有文件复制到服务器上的 /path/to/files 中。注意:只复制文件,不复制文件夹!和子文件夹的文件。请下命令。

shell ssh scp

1
推荐指数
1
解决办法
4万
查看次数

如何在远程服务器中复制文件?

我想将远程服务器中的文件从一个目录(在远程服务器中)复制到另一个(也在同一远程服务器中)。我试过这个:

scp -r myacc@remote.server:/folder_a/*myfiles* ../folder_b
Run Code Online (Sandbox Code Playgroud)

这没有给出任何错误消息,但它不起作用。我也试过这个:

scp -r myacc@remote.server:/folder_a/*myfiles* myacc@remote.server:/folder_b
Run Code Online (Sandbox Code Playgroud)

这给出了一条错误消息:

权限被拒绝,请重试。

权限被拒绝,请重试。

收到断开连接:2:myacc 丢失连接的身份验证失败太多

如何将同一服务器中的文件从一个目录复制到另一个目录?

scp remote file-copy

1
推荐指数
1
解决办法
2908
查看次数

标签 统计

scp ×10

ssh ×4

remote ×3

debian ×1

directory ×1

download ×1

file-copy ×1

files ×1

linux ×1

ls ×1

raspbian ×1

rhel ×1

shell ×1

synchronization ×1

terminal ×1

zip ×1