0% found this document useful (0 votes)
15 views1 page

SSH&SCP

This document provides instructions and examples for connecting to remote hosts using SSH and securely copying files between local and remote systems using SCP. It explains how to connect to remote hosts with SSH using a username and IP address or hostname, and optionally a port number. It also explains the syntax and examples for copying files and directories from local to remote and vice versa using SCP, including using port numbers and recursively copying directory contents.

Uploaded by

Sachin Lal MS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

SSH&SCP

This document provides instructions and examples for connecting to remote hosts using SSH and securely copying files between local and remote systems using SCP. It explains how to connect to remote hosts with SSH using a username and IP address or hostname, and optionally a port number. It also explains the syntax and examples for copying files and directories from local to remote and vice versa using SCP, including using port numbers and recursively copying directory contents.

Uploaded by

Sachin Lal MS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

# SSH & SCP Notes/Reference:

## Secure Shell (SSH):

### Connecting:

- `ssh userName@remoteHostAddress` = Connects to remote host via SSH. (Ex: `ssh


[email protected]`)

If requiring port address:


- `ssh -pXXXX userName@remoteHostAddress` = connects to remote using port number
XXXX. (Ex: `ssh -p1234 [email protected]`)

**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.

You might also like