Skip to content

Instantly share code, notes, and snippets.

@chirag773
Created January 12, 2020 05:46
Show Gist options
  • Save chirag773/ffd8efaba9adb7bcb13ab35db419a391 to your computer and use it in GitHub Desktop.
Save chirag773/ffd8efaba9adb7bcb13ab35db419a391 to your computer and use it in GitHub Desktop.

To Install ssh server

-> sudo apt-get install openssh-server

SSH uses the current user when accessing a remote server. To specify a user for an SSH connection

-> ssh username@hostname_or_ip

To connect to a remote host with a custom SSH port number, use the -p flag. For example

-> ssh username@hostname_or_ip -p <PORT>

The syntax for scp is :

If you are on the computer(Local) from which you want to send file to a remote computer:

->scp /file/to/send username@remote:/where/to/put

On the other hand if you are on the computer(Local) wanting to receive file from a remote computer:

->scp username@remote:/file/to/send /where/to/put

Copy folder from local to remote :

->scp -r /path/to/folder username@remote:/where/to/put

Copy folder from remote to local :

->scp -r user@your.server.example.com:/path/to/foo /home/user/Desktop/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment