| Description | secure copy (remote file copy program). scp copies files between hosts on a network using ssh for data transfer and authentication with the same security as ssh. Unlike rcp, scp will ask for passwords or passphrases if they are needed for authentication. |
| File | /usr/bin/scp |
| Syntax | scp [-pqrvBC46] [-F ssh_config] [-S program] [-P port] [-c cipher] [-i identity_file] [-o ssh_option] [ [user@]host1:]file1 []... [ [user@]host2:]file2 --host1, host2, ...: The name(s) of the host --file1, file2, ...: The file(s) to be copied Note: scp source dest |
| Options | -4: Forces scp to use IPv4 addresses only. -6: Forces scp to use IPv6 addresses only. -B: Selects batch mode (Prevents asking for passwords or passphrases.) -c cipher: Selects the cipher to use for encrypting the data transfer. This option is directly passed to ssh. -C: Compression enabled. Pass to ssh to enable compression. -F ssh_config: Specifies an alternative per-user configuration file for ssh. -i identity_file: Selects the file from which the identity (private key) for RSA authentication is read. This option is directly passed to ssh. -o ssh_option: The given option is directly passed to ssh. -p: Preserves modification times, access times, and modes from the original file. -P port: Specifies the port to connect to on the remote host. -q: Disables the progress meter. -r: Recursively copies entire directories. -S program: Specifies the name of the program to use for the encrypted connection. The program must understand ssh options. -v: Verbose mode. Causes scp and ssh to print debugging messages about their progress. This is helpful in debugging connection, authentication, and configuration problems. |
| Example (SUN Solaris 10) | 1. scp all files in the currently directory to directory /oraback/mydb/rman on another server dbserver2.com, log in to server dbserver2.com by using oracle 2. to copy a directory, use –r (recursive option) $ scp -r mydir xyz@dbserver2.com:mydir |
Last updated: 2010-01-19 Tuesday