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

21
votes
3answers
16k views

Restricting an SSH/SCP/SFTP user to a directory

Is there a simple way to restrict an SCP/SFTP user to a directory? All methods that I've come across require me to set a chroot jail up by copying binaries, but I don't think that should be necessary. ...
16
votes
2answers
5k views

Do you need a shell for SCP?

I'm allowing a friend a local account on my machine, exclusively for SCP. Can I specify his account's shell as /bin/true, or in any other way limit the account, while still allowing SCP?
15
votes
4answers
5k views

What's the difference between SFTP, SCP and FISH protocols?

I used to think SCP is a tool to copy files over SSH, and copying files over SSH is called SFTP, which is itself a synonym to FISH. But now as I was looking for a Total Commander plugin to do this in ...
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?
3
votes
3answers
10k 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 ...
10
votes
2answers
6k views

SCP fails without error

I've been experiencing very strange behavior of SCP for some time: whenever I try to copy a file, the output of SCP contains a bunch of underscores and the file is not copied. $ scp test.txt ...
5
votes
3answers
13k 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 ...
3
votes
2answers
1k views

Copy files from remote server to local, ignoring existing files (rsync not available)

I would like to copy a directory of files from a remote server to my local machine. As it is a large number of files, the option of ignoring existing files is desirable. Unfortunately, rsync is not ...
8
votes
5answers
9k views

Why does SCP hang on copying files larger than 1405 bytes?

I'm trying to copy a file from one of my local machines to a remote machine. Copying a file with size upto 1405 bytes works fine. When I try to scp a larger file, the file gets copied but the scp ...
3
votes
1answer
65 views

Unrar local files to remote server

I have two Linux servers, one which has several RAR files and another empty one. I would like to extract the archives and move the content to Server 2. The problem is: I do not have enough storage to ...
1
vote
2answers
143 views

Shell Script - how to scp into remote server and download files and protect password

I have a remote server that I need to download Apache logs from. I can manually scp into the server and get the files, but I'd like to put this in crontab. The only way to automate it is to include ...
1
vote
2answers
2k views

How can I scp a file that my user can't read but I can sudo?

Can I use scp to copy a file from a remote server which my login user can't read, but where I have permission to sudo to root (without password even)? How?
5
votes
3answers
385 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 ...
4
votes
5answers
4k views

How to securely allow scp, but not ssh

I work from a Mac Book Pro (called foo). I have a server where my customers scp large files to. (called bar). I frequently ssh into bar, and scp a file (called buzz) to my Mac. bob@foo$ ssh bar ...
3
votes
1answer
154 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 ...
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... ...
2
votes
2answers
3k views

How to make scp respect umask

My scp doesn't respect umask setting of the user it's sending files to. Is there a setting somewhere or should I use a different solution?
2
votes
2answers
3k views

How to scp from server to server with different public keys?

What arguments would I use for the scp command on a server to server copy if the two servers need different ssh keys? I know how to scp files from a server to a server without having data flow on the ...