From fa7d04fed4d4578fe29bdff0b5465f6e4a7da81a Mon Sep 17 00:00:00 2001 From: Jeremy Lin Date: Mon, 15 Sep 2014 21:16:46 -0700 Subject: ssh: improve key file search For private keys, use the first match from: user-specified key file (if provided), ~/.ssh/id_rsa, ~/.ssh/id_dsa, ./id_rsa, ./id_dsa Note that the previous code only looked for id_dsa files. id_rsa is now generally preferred, as it supports larger key sizes. For public keys, use the user-specified key file, if provided. Otherwise, try to extract the public key from the private key file. This means that passing --pubkey is typically no longer required, and makes the key-handling behavior more like OpenSSH. --- docs/MANUAL | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'docs/MANUAL') diff --git a/docs/MANUAL b/docs/MANUAL index 06b3abee5..18fecf6c5 100644 --- a/docs/MANUAL +++ b/docs/MANUAL @@ -41,12 +41,19 @@ SIMPLE USAGE Get a file from an SSH server using SFTP: - curl -u username sftp://shell.example.com/etc/issue + curl -u username sftp://example.com/etc/issue - Get a file from an SSH server using SCP using a private key to authenticate: + Get a file from an SSH server using SCP using a private key + (not password-protected) to authenticate: - curl -u username: --key ~/.ssh/id_dsa --pubkey ~/.ssh/id_dsa.pub \ - scp://shell.example.com/~/personal.txt + curl -u username: --key ~/.ssh/id_rsa \ + scp://example.com/~/file.txt + + Get a file from an SSH server using SCP using a private key + (password-protected) to authenticate: + + curl -u username: --key ~/.ssh/id_rsa --pass private_key_password \ + scp://example.com/~/file.txt Get the main page from an IPv6 web server: @@ -91,10 +98,13 @@ USING PASSWORDS SFTP / SCP - This is similar to FTP, but you can specify a private key to use instead of - a password. Note that the private key may itself be protected by a password - that is unrelated to the login password of the remote system. If you - provide a private key file you must also provide a public key file. + This is similar to FTP, but you can use the --key option to specify a + private key to use instead of a password. Note that the private key may + itself be protected by a password that is unrelated to the login password + of the remote system; this password is specified using the --pass option. + Typically, curl will automatically extract the public key from the private + key file, but in cases where curl does not have the proper library support, + a matching public key file must be specified using the --pubkey option. HTTP -- cgit v1.2.3