ccontavalli / ssh-ident

Different agents and different keys for different projects, with ssh.
Other
965 stars 71 forks source link

communication with agent failed: unknown option -- o #46

Open marcmarmir opened 6 years ago

marcmarmir commented 6 years ago

When running ssh-ident for the first time, a KeyError exception was thrown before the password prompt. The first time and subsequent times, a 'communication with agent failed' message was generated - it seems ssh-ident is trying to use an invalid command line option.

#####@#####-laptop:~$ ssh $$$remote-host$$$
Traceback (most recent call last):
  File "/usr/local/bin/ssh-agent", line 1027, in <module>
    sys.exit(main(sys.argv))
  File "/usr/local/bin/ssh-agent", line 992, in main
    AutodetectBinary(argv, config)
  File "/usr/local/bin/ssh-agent", line 926, in AutodetectBinary
    os.path.normpath(p) for p in os.environ['PATH'].split(os.pathsep)]
  File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
    raise KeyError(key)
KeyError: 'PATH'
Loading keys:
    /home/#####/.ssh/id_ed25519
Enter passphrase for /home/#####/.ssh/id_ed25519: 
Could not add identity "/home/#####/.ssh/id_ed25519": communication with agent failed
unknown option -- o
usage: ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]
                 [-P pkcs11_whitelist] [-t life] [command [arg ...]]
       ssh-agent [-c | -s] -k
#####@#####-laptop:~$ ssh $$$remote-host$$$
Loading keys:
    /home/#####/.ssh/id_ed25519
Enter passphrase for /home/#####/.ssh/id_ed25519: 
Could not add identity "/home/#####/.ssh/id_ed25519": communication with agent failed
unknown option -- o
usage: ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]
                 [-P pkcs11_whitelist] [-t life] [command [arg ...]]
       ssh-agent [-c | -s] -k
#####@#####-laptop:~$

I am running Ubuntu 17.10 (the openssh-client package version 7.5p1-10, but I don't know how to determine the version of ssh-agent).

I haven't yet looked into how to solve this, but it looks like the default settings don't work with a reasonably recent version of ssh-agent.

maddes-b commented 3 years ago

This seems to be a misconfiguration in your .ssh-ident or usage. Are you using alias or symbolic link to call ssh-ident wrapper for ssh? See also updated README of my fork at https://github.com/ssh-ident/ssh-ident1 Additionally see my post at superuser.com: https://superuser.com/a/1616186/557798