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

learn more… | top users | synonyms

2
votes
3answers
3k views

How to scp with regular expressions

I'm trying to copy all files that do not begin with the letter "a", in ksh. Copying from the source machine to destination machine is working fine: scp -p !(a*) user@machine:/path/directory/. But, ...
2
votes
5answers
3k views

Changing user while scp

I need to copy file between Linux machines. The problem that the user I use to login (myuser), is different from the user that can access the file. If I just ssh to the machine, I can switch the user ...
11
votes
4answers
3k views

Does a `scp` transfer close when I close the shell?

I have scp transfer (from one remote server to another), that is quite big. So maybe I want close the computer from which I executed this command, will this end the transfer? I have ssh access to ...
1
vote
4answers
1k views

How to copy Big files on other Linux Server Independent of TTY

Actually i was trying to copy all the files in another director. Total size of the file is 188GB so its going to take a time. Im trying to copy for Linux server A to B using this command nohup scp ...
0
votes
1answer
255 views

scp current folder to destination folder name as ddmmyy

I want to add a cron job that scp a folder to a server with on the server the folder name is in another folder whose folder name is a timestamp like ddmmyy something like scp -r <foldername> ...
5
votes
3answers
644 views

Tar piped to split piped to scp

So I'm trying to transfer a bunch of files via SCP. Some of these are too large to be stored on the recipient (Android phone, 4GB file size limit). The sender is almost out of space, so I can't ...
2
votes
3answers
5k views

scp force overwrite read only files

I was wanting to use scp to move some files and overwrite any existing instances of these files on the destination server. Some of them may be read only which, of course, courses the scp to fail with ...
0
votes
1answer
140 views

I'm only allowing pubkey auth via ssh. How can I still log in with password?

vi /etc/ssh/sshd_config egrep -i 'Pubkey|Password|Listen' /etc/ssh/sshd_config | grep -v '^#' ListenAddress 0.0.0.0 PermitRootLogin without-password PubkeyAuthentication yes ...
2
votes
2answers
364 views

Transfer a file from Android to a PC (not in the same network)

If I were connected by wifi in my network, there isn't any problem because with AirDroid I can access the sdcard files using the browser. However when I am out, how can I transfer a file from my ...
2
votes
3answers
2k views

Suppress server message in rsync

When I rsync or scp from a particular server I get a rather long message telling me the rules of the server. However when I setup regular pulls, I'd like to be able to suppress those messages in my ...
5
votes
2answers
2k views

Scp doesn't work in cron

Yeah, I know it's classic. I've googled it all around, but still it doesn't work. I have the following script: #First go to SVN repo folder cd $svnrepos # Just make sure we have write access to ...
2
votes
2answers
670 views

I can ssh into a remote machine but I can't use scp to copy local stuff to the remote machine

I'm using a remote machine, which is in a lab and the administrator ask a RSA public key and then I can login into that machine using a passphrase I set now I want to use scp to copy local stuff to ...
3
votes
1answer
166 views

Escaping quotes for scp

I needed to write a that behaves correctly with nasty (spaces, braces, etc..) filenames. scp -rv "$1" shiny:/Volumes/Seagate3To/\"$1\" This function works, but I don't understand why the quotes ...
1
vote
2answers
198 views

How to scp folders with nasty names using a shell function

I am trying to write a function that I will put on all my machines in order to make it easy to send files at a fixed place on my network. Here is my script so far. Some folder may have duplicates ...
2
votes
2answers
3k views

Recursive scp without following links or creating a giant tar file?

So I did a recursive scp on my remote fileserver (in another state) and it created an infinite loop of links on my remote web directory... ...
4
votes
3answers
5k views

Copy over ssh and execute commands in one session [duplicate]

Possible Duplicate: Using an already established SSH channel Here is my sync script: ssh user@remote.host /etc/init.d/some_service stop scp user@remote.host:/var/some_service/events ...
1
vote
1answer
1k views

SCP and/or SSH command with password in line

First, I'm TRYING to use rsa keys because I'm using the script to create RSA keys, but initially I have to connect to the remote machine to pass over the newly generated authentication key. Having ...
10
votes
4answers
40k views

Error using SCP: “not a regular file”

I have been searching for a while and I can't find the definition of a regular file. My path is permanent (I start at /) and I am connecting to scp root@IP: /path/to/picture.jpg Results in an ...
4
votes
1answer
992 views

scp permission denied after 'hardening' with bastille

I recently 'hardened' two Ubuntu servers using Bastille, and now I get permission denied: scp whenever I try to scp files in. SSH login works fine. I've tried adding an /scp-dump folder with 777 ...
3
votes
1answer
319 views

Configure SCP access for login without a local account

Can I set up accounts that can do SCP that are NOT local users (i.e. users with an entry in /etc/passwd)? I've tried googling for SCP "without PAM authentication" or alternative authenication for sshd ...
4
votes
2answers
4k views

How can I send single file to multiple remote sites at the same time?

Can scp be used to send a single file to multiple remote servers at the same time? If so, how? If not, what's the alternative?
2
votes
5answers
19k views

Transfer files using scp: permission denied

I try to transfer files from remote computer using ssh to my computer : scp My_file.txt user_id@server:/Home This should put My_file.txt in the home folder on my own computer, right? I get ...
3
votes
2answers
479 views

How to enable local ~ autocompletion for scp?

Too late: The machine, OS and configuration in question is no longer in use, so I can't verify any more suggestions. I have not encountered this problem in Fedora or Arch Linux. If you are having this ...
2
votes
2answers
233 views

Interesting Secure Copy Behavior

I'm not entirely sure where to ask this question, so if this is not the right place just let me know and I'll move it. Today I was trying to using recursive scp to copy a directory between two Linux ...
3
votes
2answers
971 views

Short way to scp using the same dir/file in origin and target

I am frequently updating files from a development enviroment to a production one in different servers so the paths are the same in both hosts and it becomes kind of a repetitive procedure to update a ...
4
votes
3answers
4k views

Execute remote script with local parameter value

How can I automatize this task? 1) You are at A. 2) You ssh into B. 3) You run a script at B, that needs a parameter known at A. First, I thought perhaps I could send the value when I opened the ...
6
votes
3answers
528 views

Send an email any time an SSH key is used

I have about 30 nearly-identical CentOS 6 servers that I need to be able to push out updated config files automatically using an rsa key to log in as root. Usually this will just be rsync, but ...
16
votes
4answers
15k views

Is there ever a reason to use scp instead of rsync?

Is there a reason to use scp instead of rsync? I can see no reason for using scp ever again, rsync does everything that scp does, with more safety (can preserve symlinks etc).
4
votes
1answer
20k views

How do I use sftp to get a directory and all its contents? [duplicate]

When I try to use the command get from sftp, I get the error saying that it is not a normal file. Is there a way around this?
4
votes
2answers
4k views

Disable direct login for normal users (like oracle) in linux but allow scp and sftp?

Is it possible to disable direct login for normal users (like oracle) in linux but allow scp and sftp for that use?
9
votes
4answers
13k views

How to copy with SCP between two servers using key auth?

I can log in via SSH using key authentication to SERVER1 and SERVER2. However, I can't copy files between the two servers. Why? How can I copy between them? (the data that I have to copy is bigger ...
1
vote
1answer
2k views

Why is this scp command creating a directory one level up?

I am trying to copy a file from one machine to another machine via ssh. Both machines are Ubuntu servers. Both machines have exchaged keys so that they can log into each other without passwords. The ...
4
votes
3answers
1k views

scp: localhost password not accepted

I'm attempting to copy a public key to a remote server. I'm logged in locally as [localname] and the key resides locally at ~/.ssh/. I'm also ssh'd into [remote.com] as [remotename], and attempting to ...
2
votes
0answers
171 views

Vim - Cursorline turns on after saving a remote file

Using vim scp://.... I open a remote file. cursorline is not shown until I save the file(:w). When I type :w and enter password, cursorline appears.If I type :set nocursorline it disappears but again ...
3
votes
3answers
439 views

Where did scp put these files?

I ran an scp command to download some files from an SSH server. Instead of using the . to put it in the current folder, I accidentally typed *. It looks like scp copied the files and put them ...
6
votes
2answers
2k views

Problem in secure copying (scp) filenames with spaces

I am trying to copy files using secure copy(scp). I am trying to execute the following command but I get error due to the space in the absolute path of the location of the directory. scp -r -P 8484 ...
1
vote
1answer
1k views

Unable to use scp on Solaris

I'm trying to use scp from one Solaris machine to another, but I get this message and the copy fails: root@ark123 # scp -r emcgrab_SunOS_v4.4.4a.tar 192.163.119.21:/tmp Password: Sourcing ...
5
votes
3answers
400 views

Copying large tree from one machine to another, maintaining ownership

I am trying to copy a large folder structure between machines. I want to maintain the ownership/rights during the copy as it is not reasonable to 'fix' the privs afterwards. Therefore, I am using the ...
7
votes
2answers
204 views

Is it possible to make scp fail when you do a local copy?

Is it possible to make scp fail when you do a local copy? I find it annoying to accidently create files with names like 192.168.11.5 when I meant to type 192.168.11.5: and hence copying the file to ...
30
votes
2answers
18k views

How to use wildcards (*) when copying with scp?

Why can't I copy with scp when I'm using * characters in the path? scp SERVERNAME:/DIR/* . What configs do SCP need to allow * in the path? UPDATE: the problem is not on server side, pscp is ...
3
votes
3answers
11k views

How to auto type password for SCP or SFTP to automate it?

I have script where I put scp command to backup file to other server. But when it runs it asking to type password. Is there way to automate this? I am using CentOS 5.6. I have seen few guides they use ...
1
vote
3answers
4k views

how to find out the ip of an ssh HostName

Is there a simple way to retrieve the IP of a HostName from an ssh config on the command line? Many times I have to use scp and would like to connect to a machine, but I remember only the HostName.
5
votes
2answers
278 views

Provide user name when using vim with scp

I was reading about SSH here http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html and found that you can use vim to directly modify a file on a remote server that you can ssh into. ...
5
votes
0answers
205 views

Copy file over existing SSH session? [duplicate]

Possible Duplicate: SSH easily copy file to local system Let's give the following example: I've connected to ssh user@myserver.com. I need to copy a local file over to the remote ...
5
votes
2answers
3k views

Provide parameters to scp with xargs

When I run svn st | awk '{print $2}', I get: a.py b.py c.py Then I want to scp these files to a remote server. I have tried: svn st | awk '{print $2}' | xargs scp my_name@my_server:~/ But it ...
0
votes
1answer
973 views

Are there any “scp -p” just like “cp -p”

So if I need to preserve the permissions/user/group infos of files then I can copy them with "cp -p foo fooo". But are there any "preserving" options in scp? When copying between servers.
4
votes
3answers
2k views

SCP works, but SSH doesn't (over wifi)

As the title says, when I'm using wifi at my office, I'm able to copy files to and from my server using SCP, but for some reason SSH is non-responsive. It just hangs, doesn't print anything, and I ...
6
votes
3answers
15k views

How to pull a file from a server using scp?

I am on machine A and want to pull a file from machine B. A$ scp <myuserid>@hostB:<path of file in B> . it says that: scp: <path of file in B>: No such file or directory But on ...
16
votes
3answers
27k views

How to get full path of original file of a soft symbolic link?

I want to scp a file to a server. The file is a symbolic link, and actually what I want to do is copying the source file. Anyway I don't want to track source file's path manually, because it can be ...
0
votes
3answers
5k views

How to copy files from linux to windows using winscp from a folder which contains millions of files

I need to copy files from a linux machine to a windows machine where the only ports which can be open are for SSH (22). I can connect to the linux machine using WinSCP but the problem is once I try to ...