Skip to content

Password prompt to stderr instead of stdout #524

Closed

Description

@emreture

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?

example:
rclone md5sum mydrive:mydir > mydir.md5

I'm using rclone v1.29

Best regards.
Emre

Activity

  1. klauspost commented on Jun 16, 2016

    @klauspost
    Contributor

    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.

  2. ncw commented on Jun 16, 2016

    @ncw
    Member

    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.

  3. emreture commented on Jun 16, 2016

    @emreture
    Author

    Providing an option to write the output to a file might be a better solution.

    For example:
    rclone –output-file=mydir.md5 md5sum mydrive:mydir

  4. added this to the milestone on Aug 25, 2016
  5. ivandeex commented on Oct 27, 2020

    @ivandeex
    Member

    Related issue: password handling in background rclone mount #2968

  6. ivandeex commented on Oct 16, 2021

    @ivandeex
    Member

    inactive for 5 years

  7. arichiardi commented on Oct 24, 2024

    @arichiardi

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions