Any way to quickly paste a user password into an ssh session?

Options
JetForMe
JetForMe
Community Member

I work with a lot of cloud servers. I ssh into them using authorized keys, so I don’t have to type a password. But then I often have to sudo commands, and that requires I type the current user’s password (that is, the password of the user on the remote machine).

The macOS terminal window title contains (among other things) <localuser> — ssh <remotehost> or <localuser> — ssh <remoteuser>@<remotehost> if a different user was used for the ssh session. 1Password should be able to extract that information to determine which user password to then paste into the terminal window when I sudo something.

That would be awesome.

Note: with appropriate xterm configuration on the remote side, this would even work if I'm sudoed to another user on the remote host.


1Password Version: 7.5
Extension Version: Not Provided
OS Version: macOS 10.15
Sync Type: Not Provided

Comments

  • JetForMe
    JetForMe
    Community Member
    Options

    LOL it looks like this isn't the first time I've wanted this. But I'm 99% sure it's possible: https://discussions.agilebits.com/discussion/22007/feature-request-enter-password-into-terminal-app

  • ag_ana
    ag_ana
    1Password Alumni
    Options

    Hi @JetForMe!

    I am not aware of a way to do this at the moment, but you can already drag and drop the passwords from 1Password mini in your menu bar to the Terminal window ;) It's not what you are looking for, but I am hoping it can help a little bit!

  • JetForMe
    JetForMe
    Community Member
    Options

    Not sure that’s much easier than clicking on the password and pasting, What sucks is finding the password. I almost always have to search for it.

  • t0hvanah
    t0hvanah
    Community Member
    Options

    For your specific use case (terminal) could you use AppleScript along with the new 1Password CLI tool? I haven't tried it yet, and don't think it works with local vaults anyway.

    I'm chiming in just because I'm also looking/hoping/suggesting 1Password put some efforts towards improving it's interaction in macOS outside of a web browser!

  • JetForMe
    JetForMe
    Community Member
    Options

    Oh! Yes probably! Thanks for pointing that out!

  • ag_ana
    ag_ana
    1Password Alumni
    Options

    :+1: :)

This discussion has been closed.