

You can also ask curl to pick the most secure ones out of the ones that the server accepts for the given URL, by using -anyauth. Without telling which method to use, curl defaults to Basic.

HTTP offers many different methods of authentication and curl supports several: Basic, Digest, NTLM and Negotiate (SPNEGO). HTTPĬurl also supports user and password in HTTP URLs, thus you can pick a file like: curl specify user and password separately like in curl -u name:passwd 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. 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. 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 using FTPS:// as prefix is the implicit way as described in the standards while the recommended explicit way is done by using FTP:// and the -ssl-reqd option. It is just like for FTP, but you may also want to specify and use SSL-specific options for certificates etc. To ftp files using name and password, include them in the URL like: curl specify them with the -u flag like curl -u name:passwd Get a web page and store in a local file, make the local file get the name of the remote document (if no file name part is specified in the URL, this will fail): curl -O įetch two files and store them with their remote names: curl -O -O /download.html Get a web page and store in a local file with a specific name: curl -o thatpage.html Get the main page from an IPv6 web server: curl " Get a file from an SMB server: curl -u "domain\username:passwd" smb:///share/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 Get a file from an SSH server using SCP using a private key (not password-protected) to authenticate: curl -u username: -key ~/.ssh/id_rsa scp:///~/file.txt Get a file from an SSH server using SFTP: curl -u username s Or use the more appropriate FTPS way to get the same file: curl -ftp-ssl Get a file off an FTPS server: curl ftps:///secrets.txt Get the definition of curl from a dictionary: curl dict:///d:curl Get the all terms matching curl from a dictionary: curl dict:///m:curl Get a directory listing of an FTP site: curl Get a web page from a server using port 8000: curl Get a README file from an FTP server: curl Get the main page from a web-server: curl
