I'm trying to generate an RSA key pair for a user on a multi-user remote host so that it can connect to another remote host.
When I run:
ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa -C "notes"
It returns: Could not create directory '/var/www/vhosts/domain.com/.ssh.
The "could not create directory" aside, this doesn't seem like the best location to be storing my private key.
Where should I be storing these files? and any ideas as to what I'm doing wrong.
Thanks!
Update I gave the user Sudo rights. and ran keygen via sudo -u user and still got permission denied.
It doesn't seem like I'm logged in properly. When I log in with my users credentials I get -bash-3.2$ instead of user$
ssh-keygenputs public and private keys in a user's$HOME/.sshdirectory. Are you generating the key as some other user? The account you're using looks to be using a website file directory as its home. – birryree Apr 3 '12 at 17:23