GO KALI FREE
Remote Access Commands

scp Linux Command

Securely copies files between local and remote hosts over SSH.

What does scp do?

Securely copies files between local and remote hosts over SSH.

Syntax

scp [options] source destination

Practical example

scp file.txt kali@remote:/home/kali/

Questions about scp

How do I copy a file to a remote server?

Use `scp file.txt user@remote:/path/` to copy a file from your local machine to the remote server.

How do I copy a file from a remote server?

Use `scp user@remote:/path/file.txt /local/path/` to copy a file from the remote server to your local machine.

How do I copy a directory with scp?

Use `scp -r /local/dir user@remote:/path/` to recursively copy a directory and all its contents.

How do I use a non-standard SSH port with scp?

Use `scp -P 2222 file.txt user@remote:/path/` to specify port 2222. Note the uppercase -P.

How do I preserve file permissions with scp?

Use `scp -p file.txt user@remote:/path/` to preserve modification times, access times, and permissions.

How do I copy between two remote servers?

Use `scp user1@host1:/path/file user2@host2:/path/` to copy directly between two remote machines.

How do I limit bandwidth with scp?

Use `scp -l 1000 file.txt user@remote:/path/` to limit bandwidth to 1000 Kbit/s.

What is the difference between scp and rsync?

scp copies files once. rsync can sync directories, resume interrupted transfers, and only transfer changed parts of files.

Related Remote Access Commands

ssh

Connects securely to a remote machine via the SSH protocol.

rsync

Efficiently syncs files and directories between two locations (local or remote).

ssh-copy-id

Copies your SSH public key to a remote server for key-based authentication.

ftp

Transfers files to and from a remote host using the File Transfer Protocol.

ssh-keygen

Generates SSH public/private key pairs for passwordless authentication.

sftp

Securely transfers files over SSH (interactive FTP-like interface).