linux 无交互生成ssh rsa免秘证书

[root@xxx tmp]# man ssh-keygen
NAME
ssh-keygen - authentication key generation, management and conversion

SYNOPSIS
ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment] [-f output_keyfile]
ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
ssh-keygen -i [-f input_keyfile]
ssh-keygen -e [-f input_keyfile]
ssh-keygen -y [-f input_keyfile]
ssh-keygen -c [-P passphrase] [-C comment] [-f keyfile]
ssh-keygen -l [-f input_keyfile]
ssh-keygen -B [-f input_keyfile]
ssh-keygen -D pkcs11
ssh-keygen -F hostname [-f known_hosts_file] [-l]
ssh-keygen -H [-f known_hosts_file]
ssh-keygen -R hostname [-f known_hosts_file]
ssh-keygen -r hostname [-f input_keyfile] [-g]
ssh-keygen -G output_file [-v] [-b bits] [-M memory] [-S start_point]
ssh-keygen -T output_file -f input_file [-v] [-a num_trials] [-W generator]
ssh-keygen [-n] [-D smartcard]
ssh-keygen -s ca_key -I certificate_identity [-h] [-Z principals] [-O option] [-V validity_interval] [-z serial_number] file ...
ssh-keygen -L [-f input_keyfile]

-t type
Specifies the type of key to create. The possible values are “rsa1” for protocol version 1 and “dsa”, “ecdsa” or “rsa” for protocol version 2.
-f filename
Specifies the filename of the key file.
-N new_passphrase
Provides the new passphrase.

[root@xxx tmp]# ssh-keygen -t rsa -N '' -f $(date '+%s').rsa
Generating public/private rsa key pair.
Your identification has been saved in 1510671746.rsa.
Your public key has been saved in 1510671746.rsa.pub.
The key fingerprint is:
19:f8:04:41:7c:18:82:ed:60:52:ff:72:ac:7d:8f:07 root@xxx
The key's randomart image is:
+--[ RSA 2048]----+
| ..o.o=+ |
|. +...oo. |
| o o. ..o |
| .o o o |
| . + S |
| = E |
| . . .. |
| . o. |
| ... |
+-----------------+
[root@xxx tmp]# ll
total 48K
-rw------- 1 root root 1.7K Nov 14 23:02 1510671746.rsa
-rw-r--r-- 1 root root 402 Nov 14 23:02 1510671746.rsa.pub

posted @ 2017-11-14 23:24  hufangrui  阅读(1592)  评论(0编辑  收藏  举报