I created a new user golden
in linux by running adduser
command.
After that I am trying to generate ssh keys for that new user and every time I am getting permission denied error:
golden@machineA:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/golden/.ssh/id_rsa):
Could not create directory '/home/golden/.ssh': Permission denied
Any thoughts what is wrong?
Update:
golden@machineA:~$ pwd
/home/golden
golden@machineA:~$ ls -l
total 0
golden@machineA:~$ ls -lrth
total 0
golden@machineA:~$ ls -lrtha
total 20K
-rw-r--r-- 1 10001 10001 675 May 10 11:54 .profile
-rw-r--r-- 1 10001 10001 3.5K May 10 11:54 .bashrc
drwxr-xr-x 2 10001 10001 4.0K May 10 11:54 .
-rw-r--r-- 1 10001 10001 220 May 10 11:54 .bash_logout
drwxr-xr-x 8 root root 4.0K May 10 15:44 ..
Update2:
golden@machineA:~$ ls -ld /home/golden
drwxr-xr-x 2 10001 10001 4096 May 10 11:54 /home/golden
golden@machineA:~$ id golden
uid=1001(golden) gid=1002(golden) groups=1002(golden)
ls -l
outputs on the home directory? – phk May 10 '17 at 23:13ls -ld /home/golden
. Also output ofid golden
– ivanivan May 10 '17 at 23:24