Comment 1 for bug 912123

Revision history for this message
wang yang (wang-yang1980) wrote :

i checked paramiko, in agent.py

     self.conn = None
 59 self.keys = ()
 60 if ('SSH_AUTH_SOCK' in os.environ) and (sys.platform != 'win32'):
 61 conn = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
 62 try:
 63 conn.connect(os.environ['SSH_AUTH_SOCK'])
 64 except:
 65 # probably a dangling env var: the ssh agent is gone
 66 return
 67 self.conn = conn
 68 elif sys.platform == 'win32':
 69 import win_pageant
 70 if win_pageant.can_talk_to_agent():
 71 self.conn = win_pageant.PageantConnection()
 72 else:
 73 return

it will use SSH_AUTH_SOCK envrionment variable when through auth_publickey
SSH_AUTH_SOCK=/tmp/keyring-2bBsGe/ssh

for root user, has no such envrionment variable, so it is ok.
if i add, it will fail too.