Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

ssh-agent command doesn't create env variables as stated in a man page on Ubuntu?

When I run ssh-agent it does output to the console:

SSH_AUTH_SOCK=/tmp/ssh-6xVL11wer5lW/agent.311122; export SSH_AUTH_SOCK;
SSH_AGENT_PID=311122; export SSH_AGENT_PID;
echo Agent pid 311122;

However no environmental variables are seen when run env. What is the problem? It does work with:

eval `ssh-agent` && ssh-add

But I wish to understand why cannot I simply use ssh-agent

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

UPD: On local machine I also have added file /home/user/.ssh/config to replace the need of using ssh-add:

AddKeysToAgent yes

>Solution :

Because the eval statement is mandatory to create those variables.

The command itself just print the variables/values, but are not declaring anything alone. That’s the point using eval

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading