• Avery Pennarun's avatar
    Make password prompting more clear. · bcf18923
    Avery Pennarun authored
    Based on suggestions by Jason Grossman and Ed Maste on the mailing list.
    
    We now add a [local su] prefix to the 'su' password prompt (by cheating and
    printing it before calling su), and we replace the 'sudo' password prompt
    with '[local sudo] Password: ' (by using the little-known and
    hopefully-portable -p option).
    
    We no longer call sudo or su if the uid is already 0; otherwise the prefix
    on the 'su' prompt would look weird, since su wouldn't ask for a password in
    that case.
    
    We don't add a prefix to the ssh password prompt, because it's too hard to
    tell if there will *be* an ssh password prompt.  But people will probably
    assume that the password request is for the server anyway; few people are
    likely to think that 'sshuttle -r myhost.com' is going to prompt for the
    *local* password.
    
    Of course none of this is a problem on a modern OS, like Debian, that would
    say something like "Password for apenwarr@myhost.com:" instead of just
    "Password:".  MacOS doesn't do that, however, so I assume many other OSes
    also don't.  Let's try to help them out.
    bcf18923
README.md 7.14 KB