linux ssh add 永久,Linux命令:ssh-add

1 SSH-ADD(1) BSD General Commands Manual SSH-ADD(1)2

3 NAME4 ssh-add— adds private key identities to the authentication agent5

6 SYNOPSIS7 ssh-add [-cDdkLlXx] [-t life] [file...]8 ssh-add -s pkcs119 ssh-add -e pkcs1110

11 DESCRIPTION12 ssh-add adds private key identities to the authentication agent, ssh-agent(1). When run without arguments, it adds the files ~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa,13 ~/.ssh/id_ed25519 and ~/.ssh/identity. After loading a private key, ssh-addwill try to load corresponding certificate information from the filename obtained by appending14 -cert.pub to the name of the private key file. Alternative filenames can be given on the command line.15

16 If any file requires a passphrase, ssh-add asks for the passphrase from the user. The passphrase is read from the user's tty. ssh-add retries the last passphrase if multiple

17 identity files are given.18

19 The authentication agent must be running and the SSH_AUTH_SOCK environment variable must contain the name of its socket for ssh-addto work.20

21 The options are as follows:22

23 -c Indicates that added identities should be subject to confirmation before being used forauthentication. Confirmation is performed by the SSH_ASKPASS program mentioned24 below. Successful confirmation is signaled by a zero exit status from the SSH_ASKPASS program, rather than text entered into the requester.25

26 -D Deletes all identities from the agent.27

28 -d Instead of adding identities, removes identities from the agent. If ssh-add has been run without arguments, the keys forthe default identities and their corresponding29 certificates will be removed. Otherwise, the argument list will be interpreted as a list of paths to public key files to specify keys and certificates to be removed from30 the agent. If no public key is found at a given path, ssh-addwill append .pub and retry.31

32 -e pkcs1133 Remove keys provided by the PKCS#11shared library pkcs11.34

35 -k When loading keys into or deleting keys from the agent, process plain private keys only and skip certificates.36

37 -L Lists public key parameters of all identities currently represented by the agent.38

39 -l Lists fingerprints of all identities currently represented by the agent.40

41 -s pkcs1142 Add keys provided by the PKCS#11shared library pkcs11.43

44 -t life45 Set a maximum lifetime when adding identities to an agent. The lifetime may be specified in seconds or in a time format specified in sshd_config(5).46

47 -X Unlock the agent.48

49 -x Lock the agent with a password.50

51 ENVIRONMENT52 DISPLAY and SSH_ASKPASS53 If ssh-add needs a passphrase, it will read the passphrase from the current terminal if it was run from a terminal. If ssh-adddoes not have a terminal associated with54 it but DISPLAY and SSH_ASKPASS are set, it will execute the program specified by SSH_ASKPASS and open an X11 window to read the passphrase. This is particularly useful55 when calling ssh-add from a .xsession or related script. (Note that on some machines it may be necessary to redirect the input from /dev/null to makethis work.)56

57 SSH_AUTH_SOCK58 Identifies the path of a UNIX-domain socket used to communicate with the agent.59

60 SSH_USE_STRONG_RNG61 The reseeding of the OpenSSL random generator is usually done from /dev/urandom. If the SSH_USE_STRONG_RNG environment variable is set to value other than 0the OpenSSL62 random generator is reseeded from /dev/random. The number of bytes read is defined by the SSH_USE_STRONG_RNG value. Minimum is 14bytes. This setting is not recom‐63 mended on the computers without the hardware random generator because insufficient entropy causes the connection to be blocked untilenough entropy is available.64

65 FILES66 ~/.ssh/identity67 Contains the protocol version 1RSA authentication identity of the user.68

69 ~/.ssh/id_dsa70 Contains the protocol version 2DSA authentication identity of the user.71

72 ~/.ssh/id_ecdsa73 Contains the protocol version 2ECDSA authentication identity of the user.74

75 ~/.ssh/id_ed2551976 Contains the protocol version 2ED25519 authentication identity of the user.77

78 ~/.ssh/id_rsa79 Contains the protocol version 2RSA authentication identity of the user.80

81 Identity files should not be readable by anyone but the user. Note that ssh-add ignores identity files ifthey are accessible by others.82

83 EXIT STATUS84 Exit status is 0 on success, 1 if the specified command fails, and 2 if ssh-addis unable to contact the authentication agent.85

86 SEE ALSO87 ssh(1), ssh-agent(1), ssh-keygen(1), sshd(8)88

89 AUTHORS90 OpenSSH is a derivative of the original and free ssh 1.2.12release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed91 many bugs, re-added newer features and created OpenSSH. Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0.92

93 BSD March 15, 2019 BSD

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值