Using curl to access an URL Protected by Kerberos HTTP SPNEGO
Your version of curl must support GSS and be capable of running curl -V.
To configure curl to access an URL protected by Kerberos HTTP SPNEGO:
- Run curl -V:
$ curl -V curl 7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3 Protocols: tftp ftp telnet dict ldap http file https ftps Features: GSS-Negotiate IPv6 Largefile NTLM SSL libz
- Login to the KDC using kinit.
$ kinit Please enter the password for tucu@LOCALHOST:
- Use curl to fetch the protected URL:
$ curl --negotiate -u : -b ~/cookiejar.txt -c ~/cookiejar.txt http://localhost:14000/webhdfs/v1/?op=liststatus
where: The --negotiate option enables SPNEGO in curl. The -u : option is required but the user name is ignored (the principal that has been specified for kinit is used). The -b and -c options are used to store and send HTTP cookies.
|<< Previous: Configuring the HttpFS Server to Support Kerberos Security||Next: HBase Security Configuration >>|