PDA

View Full Version : scp :: Secure copy - useful linux command



mitto
10-29-2006, 12:40 PM
scp - secure copy (remote file copy program)

scp copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security as ssh.

scp -r directory-name userid@hostname:directory-name2

To use the scp command to copy files between systems, use the following command:

scp file-name1 userid@host-name:file-name2

# scp -r ssl root@3xx.xx.xx.xx:/root/ssl/
root@xx.xx.xx.xx's password:

-p Preserves modification times, access times, and modes
from the original file.

-r Recursively copy entire directories.

-v Verbose mode.

satish_gauns
03-30-2010, 10:13 AM
Hi,

We have two Linux box (Machine A and Machine B). Standalone application running on Machine A. Target file to copy is available on Machine B.

SSH Handshaking done between Machine A and Machine B using normal user "ssh".

Standalone application running on Machine A under user "root".

Standalone application on Machine A invokes SCP command to copy the file from Machine B to Machine A. The SCP command executes successfully but file is not copied to Machine A. Message returned by SCP command is
"THIS IS A PRIVATE COMPUTER SYSTEM ---USAGE MAY BE MONITORED AND UNAUTHORIZED ACCESSOR USE MAY RESULT IN CRIMINAL OR CIVIL PROSECUTIONPermission denied, please try again.Permission denied, please try again.Permission denied (publickey,password,keyboard-interactive)."

If I manually login to Machine A and execute same SCP command I am able to copy file without any issues.

Any pointer on why invoking SCP command through standalone application give above message and file is not copied?

Thanks in Advance!

Regards,
SE

eddyfierr
07-17-2010, 01:09 PM
wow very nice information. Thank you very much for posting this. I really learned
something out of this post. I hope that you guys will keep doing this as this is really
helping others who wants to know something and wants to learn.