Created: 2023-07-16 09:58
Status: #concept
Subject: Web Development Network Engineering System Administration
Tags: Linux Shell CLI Unix Authentication openssh Network Protocol
SSH
It is a cryptographic Network Network Protocol for operating network services securely over an unsecured network.
Implementations
- see openssh to connect to a remote server and create
ssh-keygen
key pairs for authentication.
Establishing an ssh
Connection
$ ssh -v winfiru@192.168.1.17 # verbose logs option
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Given a .key
and .key.pub
Use the key as input to the ssh command via
-i <YOUR_KEY>.key
after making it have strict permissions.
chmod 600 ssh-key-2024-03-01.key
ssh ubuntu@213.35.113.138 -i ~/ssh-key-2024-03-01.key
scp <src> <host>:<dest>
"secure copy"
- similar to rsync, we can swap the
<host>:<dest>
and<src>
to transfer from another host to our local machine. - it only performs a linear copy and does not incrementally track changes.
$ scp myfile.txt vbox@192.168.1.5:/remote/directory
$ scp vbox@192.168.1.5:/remote/directory/myfile.txt /local/directory
$ scp -r mydir vbox@192.168.1.5:/remote/directory # performs a recursive copy