CURLOPT_FTP_ALTERNATIVE_TO_USER(3)
π CURLOPT_FTP_ALTERNATIVE_TO_USER(3) β¨
okay so this is a page from the Library Functions Manual (libcurl girlies rise up π«Ά) and it's about one specific little curl knob. buckle up bestie, it's short but it eats.
πΈ NAME πΈ
CURLOPT_FTP_ALTERNATIVE_TO_USER β the command to use instead of USER with FTP π
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_ALTERNATIVE_TO_USER,
char *cmd);
π DESCRIPTION π
so you pass a char pointer as the parameter, and it points at a string. that string gets used to authenticate if the usual FTP "USER user" and "PASS password" negotiation fails π like, the normal handshake didn't slay, so this is the backup plan.
and ngl, this is currently only known to be required when you're connecting to Tumbleweed's Secure Transport FTPS server, using client certificates for auth. that's the one iconic scenario where this thing shows up. π¦
the application does not have to keep the string around after setting this option β lowkey the nicest part, no memory management drama, we love that for you π
β DEFAULT β
NULL
literally nothing, no default command, it's giving empty. π
π PROTOCOLS π
this functionality affects ftp only β ftp girlies only, everyone else can go home π§
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_FTP_ALTERNATIVE_TO_USER, "two users");
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
look at her go π "two users" as the alternative command, main character energy fr fr.
π¦ AVAILABILITY π¦
added in curl 7.15.5 β vintage but still valid, iykyk π
π₯ RETURN VALUE π₯
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK πβ¨ and non-zero means an error occurred bestie, sorry β see libcurl-errors(3) for the full breakdown.
π SEE ALSO π
CURLOPT_FTP_ACCOUNT(3)CURLOPT_FTP_SKIP_PASV_IP(3)CURLOPT_SERVER_RESPONSE_TIMEOUT(3)CURLOPT_USERNAME(3)
reminder bestie: that default is NULL, so if you don't set this, nothing gets passed. no cap, no fallback command, just vibes. π
okay that's the page!! signed off with love from the libcurl girlies, dated 2026-10-12, straight out of the libcurl release notes ππ«Άβ¨ periodt.
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms