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.
Syntax:
scp [options] [portNumber] sourceHostFileOrDirectoryPath destinationDirectoryPath
NOTE: Use Uppercase 'P' for port number flag (In SSH, we used lowercase 'p').
- Copying a File:
scp -PXXXX userName@remoteHostAddress:filePath localDirectoryPath
- Copying a Directory:
scp -r -PXXXX userName@remoteHostAddress:directoryPath localDirectoryPath
Use -r
flag : Recursively copies directory contents.
- Copying a File:
scp -PXXXX localDirectoryPath userName@remoteHostAddress:directoryPath
- Copying a Directory:
scp -r -PXXXX localDirectoryPath userName@remoteHostAddress:directoryPath
Use -r
flag : Recursively copies directory contents.