Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
开发者_C百科 Improve this questionI want to generate ssh public key using ssh-keygen with custom host name in it at the end of the file . How to change the host name locally in bash.
Just provide the -C
flag, the stuff at the end of the file is only a comment, not used for anything else except differentiation.
ssh-keygen -C "somecomment@somehostname"
The hostname at the end of the key file (id_rsa.pub) is just a comment. You can change is with any editor.
or if you really want to do it from the command line:
awk '{$3 = "myname@myhost.com"; print;}' id_rsa.pub > new_id_rsa.pub
精彩评论