SCP(1)

πŸ’– SCP(1) πŸ’–

okay bestie, so this is the manual page for scp, from the General Commands Manual section of your friendly neighborhood Unix system. sit down, grab a boba, we're learning file copying 🫢


✨ NAME ✨

scp β€” secure copy (remote file copy program). literally what it says on the tin, no cap πŸ’…


🌸 SYNOPSIS 🌸

scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
    [-l limit] [-o ssh_option] [-P port] [-S program]
    [[user@]host1:]file1 ... [[user@]host2:]file2

like. it's giving "give me a file and a destination and I'll handle it" ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

scp copies files between hosts on a network. it uses ssh(1) for the actual data transfer, and it uses the same authentication and provides the same security as ssh(1). so if you trust ssh, you already trust scp. slay. πŸ”₯

scp will ask for passwords or passphrases if they are needed for authentication β€” like it's not gonna just break in silently, it'll ask, because it's polite πŸ’…

File names may contain a user and host specification to indicate that the file is to be copied to/from that host. Local file names can be made explicit using absolute or relative pathnames to avoid scp treating file names containing ':' as host specifiers. (yes bestie, that colon is doing WORK β€” it's the whole host separator vibe.) Copies between two remote hosts are also permitted. iconique.

The options are as follows:


πŸ’… OPTIONS πŸ’…

  • -1 β€” Forces scp to use protocol 1.
  • -2 β€” Forces scp to use protocol 2.
  • -3 β€” Copies between two remote hosts are transferred through the local host. Without this option the data is copied directly between the two remote hosts. Note that this option disables the progress meter (rip the lil progress bar 😭).
  • -4 β€” Forces scp to use IPv4 addresses only.
  • -6 β€” Forces scp to use IPv6 addresses only.
  • -B β€” Selects batch mode, which prevents asking for passwords or passphrases. no interruptions, just vibes.
  • -C β€” Compression enable. Passes the -C flag to ssh(1) to enable compression. smaller packets, bigger energy ✨
  • -c cipher β€” Selects the cipher to use for encrypting the data transfer. This option is directly passed to ssh(1).
  • -F ssh_config β€” Specifies an alternative per-user configuration file for ssh. This option is directly passed to ssh(1).
  • -i identity_file β€” Selects the file from which the identity (private key) for public key authentication is read. This option is directly passed to ssh(1).
  • -l limit β€” Limits the used bandwidth, specified in Kbit/s.
  • -o ssh_option β€” Can be used to pass options to ssh in the format used in ssh_config(5). This is useful for specifying options for which there is no separate scp command-line flag. For full details of the options listed below, and their possible values, see ssh_config(5).

so here's the whole list of what you can hand over through -o, and yes we're listing every single one because bestie we do NOT skip πŸ’–:

  • AddressFamily
  • BatchMode
  • BindAddress
  • CanonicalDomains
  • CanonicalizeFallbackLocal
  • CanonicalizeHostname
  • CanonicalizeMaxDots
  • CanonicalizePermittedCNAMEs
  • CertificateFile
  • ChallengeResponseAuthentication
  • CheckHostIP
  • Cipher
  • Ciphers
  • Compression
  • CompressionLevel
  • ConnectionAttempts
  • ConnectTimeout
  • ControlMaster
  • ControlPath
  • ControlPersist
  • GlobalKnownHostsFile
  • GSSAPIAuthentication
  • GSSAPIDelegateCredentials
  • HashKnownHosts
  • Host
  • HostbasedAuthentication
  • HostbasedKeyTypes
  • HostKeyAlgorithms
  • HostKeyAlias
  • HostName
  • IdentitiesOnly
  • IdentityAgent
  • IdentityFile
  • IPQoS
  • KbdInteractiveAuthentication
  • KbdInteractiveDevices
  • KexAlgorithms
  • LogLevel
  • MACs
  • NoHostAuthenticationForLocalhost
  • NumberOfPasswordPrompts
  • PasswordAuthentication
  • PKCS11Provider
  • Port
  • PreferredAuthentications
  • Protocol
  • ProxyCommand
  • ProxyJump
  • PubkeyAcceptedKeyTypes
  • PubkeyAuthentication
  • RekeyLimit
  • RhostsRSAAuthentication
  • RSAAuthentication
  • SendEnv
  • ServerAliveInterval
  • ServerAliveCountMax
  • StrictHostKeyChecking
  • TCPKeepAlive
  • UpdateHostKeys
  • UsePrivilegedPort
  • User
  • UserKnownHostsFile
  • VerifyHostKeyDNS
  • -P port β€” Specifies the port to connect to on the remote host. Note that this option is written with a capital P, because -p is already reserved for preserving the times and modes of the file. yes the case matters bestie, do not come for me 😀
  • -p β€” Preserves modification times, access times, and modes from the original file. keeping the metadata cute and intact πŸŽ€
  • -q β€” Quiet mode: disables the progress meter as well as warning and diagnostic messages from ssh(1).
  • -r β€” Recursively copy entire directories. Note that scp follows symbolic links encountered in the tree traversal.
  • -S program β€” Name of program to use for the encrypted connection. The program must understand ssh(1) options.
  • -v β€” Verbose mode. Causes scp and ssh(1) to print debugging messages about their progress. This is helpful in debugging connection, authentication, and configuration problems. the "why is it not working" flag fr fr πŸ™ˆ

πŸŽ€ EXIT STATUS πŸŽ€

The scp utility exits 0 on success, and >0 if an error occurs.

so: zero = we ate. anything bigger = something went wrong 😭


πŸ‘‘ SEE ALSO πŸ‘‘

sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), ssh_config(5), sshd(8)

the whole ssh cinematic universe, honestly. iykyk πŸ’œ


🌈 HISTORY 🌈

scp is based on the rcp program in BSD source code from the Regents of the University of California. a true legacy icon, generational πŸ’…


πŸ“ AUTHORS πŸ“

  • Timo Rinne <tri@iki.fi>
  • Tatu Ylonen <ylo@cs.hut.fi>

thank you for your service kings πŸ«‘πŸ’–


and that's the page bestie!! this one came from Debian, dated July 16, 2016 β€” shoutout to the Debian girlies keeping the SCP(1) manual page alive for us all this whole time. mwah, go copy some files safely πŸ¦‹βœ¨πŸ’