SSH key using a manual username

lagreca
lagreca
Community Member
edited May 2022 in SSH

I have a .ssh/config file that defines my hosts that I connect to via ssh. When I put the 1password ssh key line in the config file, when I try to connect to one of my hosts, it ignores my configured username and instead uses my mac username. If I comment out the 1password integration section, it goes back to using my configured username in the config file.....

Is there any plan on allowing custom users?


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

Comments

  • XIII
    XIII
    Community Member

    Usernames are not part of SSH keys and you should already be able to specify a user in your SSH config file (I already do that):

    Host pi
        HostName pi.home.lan
        User lagreca
    

    (example: use user "lagreca" when logging in to "pi.home.lan" using "ssh pi")

  • Hi @lagreca:

    Thanks for reaching out about this. By any chance, do you have any additional settings configured by Host *?

    I just did a quick test with my config looking like this:

    Host github.com
        User git
    
    Host *
      IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
    

    With this I was able to run ssh -T github.com, and successfully use my SSH key from the IdentityAgent configuration line, without it affecting the User line specific to Host github.com.

    Let me know!

    Jack

  • lagreca
    lagreca
    Community Member

    Not sure what happened, but ssh is now using the user specified in my config file....... Must have been some weird glitch, that was probably not caused by 1password.

This discussion has been closed.