Sunday, October 12, 2014

Secure copy - an introduction

Secure copy  [scp] is a remote file copy program which comes as a sub-module in OpenSSH. It uses SSH as underlying protocol to transfer data and uses the same authentication. A simple command to copy a file to a remote host is:

scp file user@remote_ip:

There are several options which we can pass to scp [in the command-line itself] like options for ipv4 [-4], ipv6 [-6], option for enabling compression [-C], specifying per-user config file for ssh [-F ssh_config], etc which are passed to underlying ssh process. Additionally, options can be passed in the format used in ssh_config.

Scp works in source and sink modes i.e. 'from' and 'to' which can be seen in the codes and can be realized from the command line also. Users are suggested to go through its manual page. This can be found either by executing "man 1 scp" in the terminal or from the internet ex. 'manual' link of OpenSSH.

Sometimes we need to debug issues in scp for which we may need to see the process hierarchy. For this, we can have a look at "ps -elf" and "pstree -p" and grep for 'ssh' and 'scp' for knowing the process hierarchy in ssh and scp.

Readers are suggested to comment for any rectification on this post or suggestion.

No comments:

Post a Comment