๐ How I Configured SSH Access from My Local Linux Mint to a VPS
A clean DevOps-style SSH setup for secure and fast server access.
๐ง Architecture Overview (Diagram)
flowchart LR
A[Local Linux Mint Machine] --> B[SSH Key Pair]
B --> C[Private Key: moti-dig-1]
B --> D[Public Key: moti-dig-1.pub]
D --> E[VPS Server]
E --> F[~/.ssh/authorized_keys]
A -->|ssh moti-dig-1| E
๐ Step 1: Generate SSH Key (Custom Name)
Instead of default keys like id_rsa, I created a dedicated key for this server:
ssh-keygen -t ed25519 -C "moti-dig-1" -f ~/.ssh/moti-dig-1
This creates:
-
~/.ssh/moti-dig-1โ Private key -
~/.ssh/moti-dig-1.pubโ Public key
๐ค Step 2: Copy Public Key to VPS
ssh-copy-id -i ~/.ssh/moti-dig-1.pub -p 44 root@165.22.104.176
This installs the public key into:
~/.ssh/authorized_keys
on the VPS.
๐งช Step 3: Test SSH Connection
ssh -i ~/.ssh/moti-dig-1 -p 44 root@165.22.104.176
Once successful, we move to automation.
โ๏ธ Step 4: SSH Config for Clean Access
Edit SSH config:
nano ~/.ssh/config
Add:
Host moti-dig-1
HostName 165.22.104.176
User root
Port 44
IdentityFile ~/.ssh/moti-dig-1
StrictHostKeyChecking accept-new
โก Step 5: Connect with Simple Command
Now access the server with:
ssh moti-dig-1
No IP, no port, no key flags.
๐ Security & Best Practices
- Use
ed25519keys (modern & secure) - Keep one key per server/project
- Use SSH config for clean workflow
- Set proper permissions:
chmod 600 ~/.ssh/moti-dig-1
chmod 600 ~/.ssh/config
๐ Final Thoughts
This setup improves:
- Security ๐
- Productivity โก
- Maintainability ๐งน
- DevOps readiness โ๏ธ
If you manage multiple servers, this setup is a must-have for scaling your workflow like a professional DevOps engineer.
Top comments (0)