Can i create a private ssh key for a user from another user
Hi all ,
I am new for linux.
I have a locked user " abc" . I am creating a password less ssh key (id_rsa) for " abc" user with root login:
ssh-keygen -q -N " " -t rsa -b 2048 -f /path/to/users/abc/id_rsa -C " abc@$(hostname)"
the generated file is working fine and i am able to login wihtout passwod in putty.
Now i need to create same ssh file for " abc" BUT from another non root user " xyz" with same command.
I have given permission of /path/to/users/abc/.ssh directory to " xyz" :
ssh-keygen -q -N " " -t rsa -b 2048 -f /path/to/users/abc/id_rsa -C " abc@$(hostname)"
Above command executes and create /path/to/users/abc/id_rsa file successfully but when i am try to use this id_rsa on my windows machine with putty, its asking for password and failed.
Please help.