Ubuntu – ssh: Could not resolve hostname add: Name or service not known

sshssh-agentssh-keysUbuntu

I created non-sudo user and I can't add ssh key while logined with it:

% ssh -vvv add ~/.ssh/mykey   
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
ssh: Could not resolve hostname add: Name or service not known

Ubuntu 14.04, didn't change ssh config after clean installation.

When I add key while logined as sudo user everything is ok.
I tried to do

% eval `ssh-agent -s`
Agent pid 18372

But ssh add shows the same error after this.

Best Answer

ssh -vvv add ~/.ssh/mykey will try to connect to server add and run the ~/.ssh/mykey command.

This is obviously not what you want but it certainly explains the error you're getting.