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.
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$