ssh-keygen
नेटवर्क
इस्तेमाल
ssh-keygen -t ed25519 -C "<comment>"सार्वजनिक और निजी कुंजी की जोड़ी बनाता है; सर्वर पर केवल `.pub` वाला आधा जाता है, और बिना passphrase बनाई कुंजी एक सादी फ़ाइल है जिसे कोई भी कॉपी करके लॉगिन कर सकता है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -t ed25519 | Key type. ed25519 is the modern default; rsa needs -b 4096 to be worth using. |
| -C "you@laptop" | A comment so you can tell your keys apart later. |
| -f <path> | Where to write the key, when you want more than one. |
| -N "" | No passphrase. Then the file alone is enough to log in. |
| -p | Change or add the passphrase on an existing key. |
| -l -f <key.pub> | Print the fingerprint, to compare against what a server shows. |
| -y -f <key> | Recreate the public half from a private key. |
| -R <host> | Remove a host from known_hosts after it was rebuilt. |
उदाहरण
ssh-keygen -t ed25519 -C "jade@laptop"Create a modern key pair in ~/.ssh.
ssh-keygen -R old.example.comFix the "REMOTE HOST IDENTIFICATION HAS CHANGED" warning properly.
ssh-keygen -lf ~/.ssh/id_ed25519.pubThe fingerprint of your public key.
कनेक्शन न बने तो ये बताते हैं कि बात कहाँ तक पहुँची — नाम हल नहीं हुआ, रास्ता नहीं, या पोर्ट बंद है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. ssh-keygen क्या करता है?
सार्वजनिक और निजी कुंजी की जोड़ी बनाता है; सर्वर पर केवल `.pub` वाला आधा जाता है, और बिना passphrase बनाई कुंजी एक सादी फ़ाइल है जिसे कोई भी कॉपी करके लॉगिन कर सकता है।
Q. इसे कैसे लिखें?
ssh-keygen -t ed25519 -C "<comment>" — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 8 दिए हैं; पूरी सूची man ssh-keygen में है। यह कमांड नेटवर्क में आती है।
मिलती-जुलती कमांड
man पेज: man ssh-keygen