You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My config file is password protected. When I redirect stdout to a file like the example below, the password prompt is also redirected to stdout. Wouldn't it be better if password prompt (and other prompts) is printed to stderr instead of stdout so the user can see it when stdout is redirected to a file?
I think stdout should be for stuff we intend the user to interact with so I'm not in favour of changing it to stderr unless we can find a strong precedent in some other unix tool.
That said, the standard behaviour of unix tools is to bypass stderr and stdout and output the password prompt directly to the terminal (and presumably read the prompt directly from the terminal). I don't know how this is done though though it is probably possible with a bit of messing around with golang.org/x/crypto/ssh/terminal which we use to read the password.
To see this try ssh to a host with an incorrect user that will ask for a password but with stdout and stderr redirected.
Hi all! Was there ever a resolution to this? I am using stderr to detect is there is any error on the script itself and I see the password prompt in there, which trips up my logic. I really think the passport prompt should be shown on stdout only, following unix standards...
I would be happy to attempt a fix (if the issue is worth reopening for the maintainers).
Activity
klauspost commentedon Jun 16, 2016
I am not sure if that is a better solution. I can see good arguments for redirecting stderr and keep stdout on screen.
That said, the change is trivial by changing output here.
ncw commentedon Jun 16, 2016
I think stdout should be for stuff we intend the user to interact with so I'm not in favour of changing it to stderr unless we can find a strong precedent in some other unix tool.
That said, the standard behaviour of unix tools is to bypass stderr and stdout and output the password prompt directly to the terminal (and presumably read the prompt directly from the terminal). I don't know how this is done though though it is probably possible with a bit of messing around with golang.org/x/crypto/ssh/terminal which we use to read the password.
To see this try ssh to a host with an incorrect user that will ask for a password but with stdout and stderr redirected.
emreture commentedon Jun 16, 2016
Providing an option to write the output to a file might be a better solution.
For example:
rclone –output-file=mydir.md5 md5sum mydrive:mydirivandeex commentedon Oct 27, 2020
Related issue: password handling in background rclone mount #2968
ivandeex commentedon Oct 16, 2021
inactive for 5 years
arichiardi commentedon Oct 24, 2024
Hi all! Was there ever a resolution to this? I am using stderr to detect is there is any error on the script itself and I see the password prompt in there, which trips up my logic. I really think the passport prompt should be shown on stdout only, following unix standards...
I would be happy to attempt a fix (if the issue is worth reopening for the maintainers).