Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [scp]

Secure Copy or SCP is a means of securely transferring computer files between a local and a remote host or between two remote hosts.

5
votes
1answer
194 views

Unix AIX passing variable and arguments to expect and spawn

I am writing a script to scp some files but need to pass file location through the user or another script as an argument #!/usr/bin/expect set FILEPATH1 $1 spawn sh "scp $FILEPATH1 $USER@$HOST:/...
1
vote
1answer
52 views

Why does Unix ask for password when I try to pull a file with permission 777 using scp?

Let us consider that I have a file /home/base/alpha.txt with permission 777 i.e. -rwxrwxrwx in user@host. Now, from system host1 as user1 i.e. user1@host1, I try to pull the file mentioned above using ...
0
votes
0answers
19 views

Backup interruption using scp. How to exclude files just downloaded?

I need to backup a huge folder (more than 100 GB) from an external server. I use scp command in a linux terminal but connection issues happen sometimes. So I need to restart the procedure every time. ...
-1
votes
3answers
46 views

Use scp to copy files of specific extension from directory

I'm writing a bash script that needs to fetch all *_out.csv from a directory, on a remote server. All these files are several directories deep inside of another directory. So for instance, say the ...
1
vote
2answers
36 views

How to copy files with certain extensions keeping the path from remote to local machine via scp --parents?

I want to copy all *out from various subdirectories from my remote account to my local machine my trail is scp --parents -r @remote:~/path/*out . this trail doesn't work I am wondering about the ...
0
votes
0answers
49 views

SFTP upload directories and files to a VM

I have 2 directories and 4 files drwxr-xr-x 8 root root 4096 Jun 30 2018 apache2 <<< 📁 drwx------ 2 root root 4096 Jan 23 19:40 .ssh <<< 📁 drwx------ 10 root root 4096 Mar 12 ...
1
vote
0answers
125 views

SCP gets broken pipe, but meanwhile ssh works well

I'm using Mac to ssh and scp to multiple servers (after I VPN into my company's network from my Mac at home). I can ssh from Mac via VPN to servers (I call them server A, B, and C), all the time ...
0
votes
0answers
45 views

Passwordless SCP from automated script - NO ADMIN RIGHTS server side

I have a cloudways server with no admin rights. I have set up ssh keys using their website interface, to use ssh and scp without passwords from a raspberry pi 3b+ running stretch, however i am having ...
0
votes
1answer
56 views

scp <source>:<filepath> <dest> works from command line, but cp: cannot stat error from script. Why?

I am using scp to copy a file from a server to my computer. The command works fine when I type it from the command line, but when I try to make a script to do it, it fails with a "cp: cannot stat" ...
0
votes
1answer
596 views

Scp transfer: Permission denied [closed]

Nothing that I have tried so far has worked; every time I try to transfer my file from one of my servers to the other it asks for a password and it always says permission denied (and before you ask I'...
0
votes
1answer
81 views

Use SCP from local machine to recursively copy current working directory to remote?

Trying to do something like (in pseudo-unix): scp -r <pwd> username@remote.com:~/<dirname of toplevel> In other words, I'm trying to copy the current directory I'm in locally (and the ...
5
votes
1answer
352 views

Why does scp's strict filename checking reject quoted last component but not others?

When I try to scp a file with a slash in its path, the path is quoted for the local host, and the last path component is additionally quoted for the remote host, like scp host:"a/b/'c'" ., it fails ...
0
votes
1answer
99 views

Krusader Configuration for SCP [duplicate]

A remote router is accessible via SSH: 16.04 scp copies files back and forth from the command line. ASUSWRT-Merlin RT-AC68U 384.7-2 Sun Oct 21 17:18:03 UTC 2018 USER@router:/tmp/home/root# # ...
2
votes
3answers
80 views

Copying Hundred of Thousands Files from Remote Directory to Another Remote Directory

I have a remote directory (SSH enabled) on 11.11.11.11/:/path/from (an Ubuntu machine) that has millions of tiny .txt small size files, doing like simple ls command or even opening the /path/from/ ...
1
vote
2answers
25 views

Copy mail file from maildir over ssh [duplicate]

The maildir has a specific format of the files laying underneath, e.g. 1549464014.9224_427.hostname:2,RS. In Debian environment copying this file over SSH without renaming is impossible or I don't ...
1
vote
1answer
112 views

Error in scp connection in Linux

I have got an below error while executing the below command while placing a file in gatekeeper example server through a script. scp -oHostKeyAlgorithms=+ssh-dss -i ~/.ssh/gatekeeper -P 18000 /var/...
0
votes
1answer
490 views

Jenkins pipeline: scp tries to copy to other remote, Host key verification failed [duplicate]

I use Jenkins in ubuntu server. In this case, I want to copy a file to another remote server. I use SCP command inside sshagent the Jenkins pipeline. I tried the solution from unable to scp in ...
0
votes
0answers
152 views

scp: Failed to open file /my/Path/test.txt on Windows Server

I have been trying to copy a file from a remote Windows Server to my local docker image from my local docker image and I keep getting the error 'scp:Failed to open File /my/Path/test.txt'.My ...
2
votes
0answers
146 views

How to pass options to ssh proxy command?

To collect some data from a bunch of hosts I use a bash script which calls scp in a loop. Most of these hosts are configured for ssh public key authentication. I may skip those which have no key ...
0
votes
1answer
38 views

SCP not willing to transfer remote to remote

My family and I are attempting to sync all our data across multiple locations and devices. Seeing as we are just setting it up, we were wanting to start with the basics before building on it further, ...
1
vote
1answer
129 views

Need to prefer file ownership while uploading through scp

I have been tring to upload a file through a normal user to the Amazon Gnu/Linux server, but file owner is not preferring after a successful upload. File ownership is taken from the directory, not ...
0
votes
1answer
49 views

Using service account to copy the apps

Currently we are having Git repository which is configured with srvapps (service account).I can sudo to the Git server using this account (username - srvapps and password - my login password). My ...
1
vote
0answers
131 views

input/output error using scp with external HD [closed]

I'm transferring large batch of files from a external HD via scp, between a raspberry pi and my desktop. The external HD is formatted as exFAT. Looking back, many of the files contained an input/...
0
votes
1answer
73 views

SCP requires password but if I SSH to the same server it does not

So I setup ssh keys, tested it via cli and all works great. When I go to run a SCP file transfer it asks for my password for both machines, yet if I simply ssh to the same server it does not. Below ...
0
votes
2answers
158 views

wget and scp as a pipeline

Can we use wget and scp as a pipeline. I want to wget a file from a server and copy to another server. I used below command but it is not working. wget "$Select_Release_Version_ARTIFACT_URL" | sudo ...
0
votes
2answers
131 views

Download data from DropBox to remote server (via scp)

I'm trying to transfer some large, gzipped files from a collaborator's DropBox to a remote server. Is there a way to do this with scp? Or is there a preferred method? Thank you in advance!
0
votes
1answer
72 views

scp/rsync autocomplete works one way but not the other

I have two machines, laptop and server. Both of them source /etc/bash_completion in .bashrc. What works: server$ scp file laptop:~/stage/[tab][tab] server$ scp laptop:~/stage/[tab][tab] . server$ ...
1
vote
0answers
32 views

Unintentional bandwidth throttling — where else to look?

This is embarrassing, but I seem to have inadvertently set a persistent bandwidth throttle on SSH connections from my Ubuntu machine. When transferring files from a remote server via scp, sftp, or ...
1
vote
0answers
36 views

SCP after a file has reached completion [closed]

I would like to create something that would look to see if a specific zip file is done increasing in size, then scp it to another server. These zip files get created at many different times of day, ...
0
votes
1answer
40 views

what is the right approach to copy folder content that include links

we have the following folders / links /files under /usr/hdp/2.6.0.3-8/zookeeper folder -rw-r--r--. 1 root root 794542 Apr 1 2017 zookeeper-3.4.6.2.6.0.3-8.jar drwxr-xr-x. 6 root root 4096 Mar 28 ...
0
votes
2answers
23 views

I want to transfer data from AWS to my physical computer using scp command

My AWS server has public IP address a.b.c.d and my computer has private IP address 192.168.1.25 and public IP address x.y.z.t How do I transfer data using scp command?
1
vote
1answer
81 views

Error copying directory from a remote host to another remote host with 'scp'

From my laptop, I'm trying to copy a directory of files from one Raspberry Pi (pi@192.168.2.22) to another (pi@192.168.2.21): ~/example$ scp -r pi@192.168.2.22:~/example/files_to_send pi@192.168.2.21:...
1
vote
1answer
544 views

Transferring files from remote host to local with sshpass

I want to transfer files which are older then 40 days from remote to local host. I am able to connect the remote server but unable to transfer the files from remote to local server. It results into ...
4
votes
0answers
80 views

scp using a different shell?

I have a server where the default shell is tcsh. It has been setup in its .cshrc to load a number of modules on login. So it is quite slow to login and I just have to live with it. My problem is that ...
1
vote
0answers
155 views

Create new file after `scp` in remote script [closed]

Learning bash and trying to copy a file from a local machine to a remote machine. I would like to create a simple .txt file on the local machine that logs a success. This is my first foray into bash, ...
0
votes
1answer
135 views

scp file from machine A to machine with no password prompt and copy same file to different location

I am trying to write a shell script through which i want to copy file from machineA to machine B.I have already setup passwordless connection .In the machine B again the samefile i want to copy to ...
1
vote
1answer
266 views

What happens with simultaneous scp and mv?

What happens when I scp large file from computer A to computer B, then move mv that file to a different location on the same partition of computer B before the scp is complete? I assume just the ...
0
votes
1answer
263 views

Where does SCP keep its Known_Hosts info

I am looking for the file in which scp keeps known_hosts information. Can anyone direct me where this would be on Linux? I have looked in my $HOME/.ssh directory but the information is not kept there....
1
vote
2answers
72 views

Transferring file from local computer to remote server

I would like to transfer a zip file from my local server to a remote server. I used the following command which contain host, port, and username as follows: scp "$somepath/${file}.zip" "$ftp_user"@"...
1
vote
0answers
42 views

escape the '\' character when using scp [closed]

So I'm doing a Jenkins course, I have a script that will copy an item, using a private key, but the Jenkins and the key is on a windows pc, and the path to the key is C:\tomcat.pem. I don't know how ...
0
votes
1answer
50 views

Combine zipfile: with scp: to open remote zip with vim?

Both vim scp://remotehost///path/to/file.txt and vim zipfile:/path/to/file.zip::path/inside/zip/file.txt work for opening either remote or a file inside zip archives. What if one needs both at ...
-1
votes
1answer
622 views

Copy file from Windows to Linux WHEN A SHELL SCRIPT IS EXECUTED

I have a program on Linux server, which runs a shell script on Linux server. Say "/tmp/ShellScript.sh" Now I want to copy a file placed on my Windows Machine location "C:\WindowsFolder\FileToCopy" to ...
-1
votes
1answer
264 views

Scp remote files to the local [closed]

I could copy the archive to the server from local using: scp forum.tar.gz root@servername:/root/ However, when I tried to send from server to the local [root@iz2ze9wve43n2nyuvmsfx5z ~]# scp draft....
1
vote
1answer
1k views

scp permission denied when a user does scp command for owned files on his home directory

I have checked many postings regarding 'Permission denied' error in using scp, but couldn't find the answer for my problem. There are two ubuntu servers (let's say server 'A' and 'B') on the same ...
2
votes
1answer
44 views

Why does scp seem to be failing?

The copy seems to be failing. I was actually trying to copy a large directory and assumed it was failing because of the size, so I made a simple example with a small file, to demonstrate. hduser@...
-1
votes
2answers
3k views

COPY file from one server to another [closed]

I have to get some files from production to DEV server. SCP command gives the timeout. I do not have ip and I connect to the server using ssh command as below. ssh komz-admin@pxxxxxxx04.corp.xxx....
1
vote
0answers
192 views

scp command fails only with root user [closed]

I have a strange situation where scp to a server fails but only when done with the root user. I don't understand what could be the reason. The file never exists on the target. Here is the command I ...
0
votes
1answer
287 views

scp prints some weird characters and doesn't copy files

I'm trying to copy a small file from another computer in the network using scp, the computer is running Linux Mint 18.3. I tried from macOS and I get this: $ scp fyde@192.168.1.211:/home/fyde/...
0
votes
0answers
29 views

How to copy remote NAS file behind a router [duplicate]

BACKGROUND A UNIX NAS operates behind a Unix Router. The router's SSH port is open to the WAN, however the SSH port of the NAS is LAN accessible only. One is able to SSH to the router from any WAN ...
1
vote
1answer
1k views

scp does not work but ssh does

My local machine and remote machine are both connected to the same network i.e my Android Phone hotspot. I can connect to remote machine by ssh but, the problem is when I am trying to copy some files ...