Нет, небезопасно пропускать пароли к программам в командной строке. Лучше использовать:
mohsen@debian:~$ mysql -uuser -p
Enter password:
Я смог достичь желаемой страницы в конце.
Кажется, что я не следовал за правильной последовательностью звонков URL. Как только я это сделал, нужная страница была извлечена правильно.
Большое спасибо за быстрые ответы!
Это может быть связано с перенаправленным во время авторизации. См. -L
и - Доверенные параметра
в Человек Curl
. Также попробуйте тестирование -W Redirect_url
, чтобы увидеть фактическую страницу, которую вы будете перенаправлены, если это так.
-L, --location
(HTTP/HTTPS) If the server reports that the requested page has moved to a different location
(indicated with a Location: header and a 3XX response code), this option will make curl redo the
request on the new place. If used together with -i, --include or -I, --head, headers from all
requested pages will be shown. When authentication is used, curl only sends its credentials to
the initial host. If a redirect takes curl to a different host, it won't be able to intercept the
user+password. See also --location-trusted on how to change this. You can limit the amount of
redirects to follow by using the --max-redirs option.
When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it
will do the following request with a GET if the HTTP response was 301, 302, or 303. If the
response code was any other 3xx code, curl will re-send the following request using the same
unmodified method.
--location-trusted
(HTTP/HTTPS) Like -L, --location, but will allow sending the name + password to all hosts that
the site may redirect to. This may or may not introduce a security breach if the site redirects
you to a site to which you'll send your authentication info (which is plaintext in the case of
HTTP Basic authentication).
-w, --write-out <format>
Defines what to display on stdout after a completed and successful operation. The format is a
string that may contain plain text mixed with any number of variables. The string can be speci‐
fied as "string", to get read from a particular file you specify it "@filename" and to tell curl
to read the format from stdin you write "@-".
The variables present in the output format will be substituted by the value or text that curl
thinks fit, as described below. All variables are specified as %{variable_name} and to output a
normal % you just write them as %%. You can output a newline by using \n, a carriage return with
\r and a tab space with \t.
NOTE: The %-symbol is a special symbol in the win32-environment, where all occurrences of % must
be doubled when using this option.
The variables available are:
redirect_url When an HTTP request was made without -L to follow redirects, this variable will
show the actual URL a redirect would take you to. (Added in 7.18.2)