Making Remote Access Easy: A Simple SSH Guide
Published:
Making Remote Access Easy: A Simple SSH Guide
Want to access your remote systems without the hassle of typing passwords? Let’s set it up in three easy steps.
1. Generate Your SSH Key
First, we’ll create your SSH key pair. Open your terminal and run:
ssh-keygen -t rsa
When you run this command:
- It will ask where to save the key (usually ~/.ssh/id_rsa) - just press Enter to accept the default
- It will ask for a passphrase - you can press Enter twice to skip it
- This creates two files: id_rsa (private key) and id_rsa.pub (public key)
2. Copy Your Key to the Remote Server
Now let’s copy your public key to the remote server. Here’s the easiest way:
ssh-copy-id username@remote-server
For example, if your username is john and server is example.com:
ssh-copy-id john@example.com
You’ll need to enter your password one last time for this step.
3. Make Life Even Easier with SSH Config
Create or edit ~/.ssh/config file:
nano ~/.ssh/config
Add your server details like this:
Host myserver
HostName example.com
User john
Port 22
Now instead of typing:
ssh john@example.com
You can simply type:
ssh myserver
And that’s it! You can now log in to your remote server without typing passwords or long server names.
Remember:
- Keep your private key (id_rsa) safe and never share it
- You can use different names in the config file for different servers
- The config file can handle multiple server entries
Leave a Comment