π 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)