开发者

How to change the host name locally in bash [closed]

开发者 https://www.devze.com 2023-04-04 04:05 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

开发者_C百科 Improve this question

I 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
0

精彩评论

暂无评论...
验证码 换一张
取 消