Skip to content

Instantly share code, notes, and snippets.

@purpleidea
Created September 26, 2024 16:41
Show Gist options
  • Save purpleidea/55c3b347e8215b1cc7c34121e25a7938 to your computer and use it in GitHub Desktop.
Save purpleidea/55c3b347e8215b1cc7c34121e25a7938 to your computer and use it in GitHub Desktop.
# ssh-keygen overwrites the .pub portion without asking
# i guess this is fine, but it surprised me
[root@fedora ~]# /usr/bin/ssh-keygen -t rsa -f /root/.ssh/id_rsa -N ''
Generating public/private rsa key pair.
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:dSY5/HGUZ7TKKRbB2dm8cYdE+GtgtQA1uhHOQj0ITGs root@fedora
The key's randomart image is:
+---[RSA 3072]----+
| oo..o++=+B+.|
| .o.+o*+=++*|
| E . @o++.==|
| . o O=o=. |
| S .+.= . |
| . . o |
| . |
| |
| |
+----[SHA256]-----+
[root@fedora ~]# rm .ssh/id_rsa rm: remove regular file '.ssh/id_rsa'? y
[root@fedora ~]# file .ssh/id_rsa.pub
.ssh/id_rsa.pub: OpenSSH RSA public key
[root@fedora ~]# /usr/bin/ssh-keygen -t rsa -f /root/.ssh/id_rsa -N ''
Generating public/private rsa key pair.
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:+iWJ6phFAD8dc0MSZ4mWo62vnI/PmxUCnHOplPuZtZs root@fedora
The key's randomart image is:
+---[RSA 3072]----+
|. ==*. |
| + +=O.. |
| @++. |
| ..O. |
| o.o o S |
| .o = = . |
| .= = o . |
| . B.+ + o |
| B=O.E . |
+----[SHA256]-----+
[root@fedora ~]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment