SSH Key Authentication + SSH Interview Questions

English + हिन्दी Version | TechWithAdi

SSH Key Authentication Setup (Passwordless Login)

SSH Key Authentication allows secure login without entering passwords.

Generate SSH Key

ssh-keygen -t rsa -b 4096

Copy Key to Server

ssh-copy-id user@server-ip

Login Without Password

ssh user@server-ip

Disable Password Authentication

sudo nano /etc/ssh/sshd_config

PasswordAuthentication no
PubkeyAuthentication yes
sudo systemctl restart ssh

Top 20 SSH Interview Questions

Q1. What is SSH?

SSH is a secure protocol used to connect remote systems.

Q2. What is SSH Key Authentication?

It uses public/private keys instead of passwords.

Q3. Why use SSH keys?

They are more secure than passwords.

Q4. What is a Public Key?

The key stored on the server.

Q5. What is a Private Key?

The secret key stored on the client.

Q6. What command generates SSH keys?

ssh-keygen

Q7. What is ssh-copy-id?

Copies public key to a remote server.

Q8. What is authorized_keys?

Stores allowed public keys.

Q9. Default SSH port?

22

Q10. How to test SSH login?

ssh user@server

Q11. What is sshd?

SSH daemon service.

Q12. What file controls SSH settings?

/etc/ssh/sshd_config

Q13. How to restart SSH?

sudo systemctl restart ssh

Q14. What is PasswordAuthentication no?

Disables password login.

Q15. What causes Permission denied (publickey)?

Missing or invalid key.

Q16. What is RSA?

Popular public key algorithm.

Q17. What is ED25519?

Modern secure key algorithm.

Q18. How to secure SSH?

Disable root login and password login.

Q19. What are SSH best practices?

Use keys, updates, firewall, Fail2Ban.

Q20. Explain SSH Authentication process.

Client proves identity using private key matching server public key.

SSH Key Authentication Setup (Passwordless Login)

SSH Key Authentication की मदद से बिना पासवर्ड के सुरक्षित login किया जा सकता है।

SSH Key Generate करें

ssh-keygen -t rsa -b 4096

Server पर Public Key Copy करें

ssh-copy-id user@server-ip

Passwordless Login

ssh user@server-ip

Password Authentication Disable करें

sudo nano /etc/ssh/sshd_config

PasswordAuthentication no
PubkeyAuthentication yes
sudo systemctl restart ssh

Top 20 SSH Interview Questions

प्रश्न 1. SSH क्या है?

SSH एक secure protocol है जो remote server access करने के लिए उपयोग होता है।

प्रश्न 2. SSH Key Authentication क्या है?

यह password की जगह public/private keys का उपयोग करता है।

प्रश्न 3. SSH Keys क्यों उपयोग करते हैं?

क्योंकि यह passwords से अधिक secure होती हैं।

प्रश्न 4. Public Key क्या है?

यह key server पर store होती है।

प्रश्न 5. Private Key क्या है?

यह secret key client machine पर रहती है।

प्रश्न 6. SSH Key generate करने की command?

ssh-keygen

प्रश्न 7. ssh-copy-id क्या करता है?

Public key server पर copy करता है।

प्रश्न 8. authorized_keys क्या है?

Allowed public keys store करता है।

प्रश्न 9. Default SSH Port क्या है?

22

प्रश्न 10. SSH Login कैसे test करें?

ssh user@server

प्रश्न 11. sshd क्या है?

SSH daemon service।

प्रश्न 12. SSH settings file कौन सी है?

/etc/ssh/sshd_config

प्रश्न 13. SSH restart कैसे करें?

sudo systemctl restart ssh

प्रश्न 14. PasswordAuthentication no क्या करता है?

Password login disable करता है।

प्रश्न 15. Permission denied (publickey) error क्यों आती है?

Key missing या invalid होने पर।

प्रश्न 16. RSA क्या है?

Popular public key algorithm।

प्रश्न 17. ED25519 क्या है?

Modern secure key algorithm।

प्रश्न 18. SSH को secure कैसे करें?

Root login और password login disable करें।

प्रश्न 19. SSH Best Practices क्या हैं?

Keys, updates, firewall और Fail2Ban।

प्रश्न 20. SSH Authentication Process समझाइए।

Client private key से identity prove करता है।