Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 1.55 KB

4-SSH-and-SCP.md

File metadata and controls

42 lines (26 loc) · 1.55 KB

SSH & SCP Notes/Reference:

Secure Shell (SSH):

Connecting:

  • ssh userName@remoteHostAddress = Connects to remote host via SSH. (Ex: ssh tester@add1sun.com)

If requiring port address:

  • ssh -pXXXX userName@remoteHostAddress = connects to remote using port number XXXX. (Ex: ssh -p1234 tester@add1sun.com)

Use lowercase 'p' for port Number

Once you login, you may use basic linux commands to move around the directories or manipulate files on the remote system.

Secure Copying (SCP):

Syntax:

  • scp [options] [portNumber] sourceHostFileOrDirectoryPath destinationDirectoryPath

NOTE: Use Uppercase 'P' for port number flag (In SSH, we used lowercase 'p').

Coyping from Remote to Local:

  1. Copying a File: scp -PXXXX userName@remoteHostAddress:filePath localDirectoryPath
  2. Copying a Directory: scp -r -PXXXX userName@remoteHostAddress:directoryPath localDirectoryPath

Use -r flag : Recursively copies directory contents.

Coyping from Local to Remote:

  1. Copying a File: scp -PXXXX localDirectoryPath userName@remoteHostAddress:directoryPath
  2. Copying a Directory: scp -r -PXXXX localDirectoryPath userName@remoteHostAddress:directoryPath

Use -r flag : Recursively copies directory contents.