Yep. That's what I get for following the advice from other forums. So what are the default/usual/normal/correct directory and file ownerships?
[root directory]
root@server1:/# ll
total 80
drwxr-xr-x 21 root root 4096 Aug 3 09:46 ./
drwxr-xr-x 21 root root 4096 Aug 3 09:46 ../
drwxr-xr-x 2 root root 4096 Aug 3 09:54 bin/
drwxr-xr-x 3 root root 4096 Aug 3 10:00 boot/
drwxr-xr-x 13 root root 4120 Aug 8 07:43 dev/
drwxr-xr-x 90 root root 4096 Aug 9 00:23 etc/
drwxr-xr-x 4 root root 4096 Aug 9 00:24 home/
lrwxrwxrwx 1 root root 33 Aug 3 09:46 initrd.img -> boot/initrd.img-3.13.0-32-generic
drwxr-xr-x 21 root root 4096 Aug 3 09:54 lib/
drwx------ 2 root root 16384 Aug 3 09:43 lost+found/
drwxr-xr-x 6 root root 4096 Aug 7 04:38 media/
drwxr-xr-x 3 root root 4096 Aug 6 19:44 mnt/
drwxr-xr-x 2 root root 4096 Jul 22 17:48 opt/
dr-xr-xr-x 84 root root 0 Aug 8 07:42 proc/
drwx------ 2 root root 4096 Aug 3 10:22 root/
drwxr-xr-x 18 root root 640 Aug 8 23:48 run/
drwxr-xr-x 2 root root 4096 Aug 3 10:01 sbin/
drwxr-xr-x 2 root root 4096 Jul 22 17:48 srv/
dr-xr-xr-x 13 root root 0 Aug 8 07:42 sys/
drwxrwxrwt 3 root root 4096 Aug 9 00:33 tmp/
drwxr-xr-x 10 root root 4096 Aug 3 09:43 usr/
drwxr-xr-x 12 root root 4096 Aug 3 09:56 var/
lrwxrwxrwx 1 root root 30 Aug 3 09:46 vmlinuz -> boot/vmlinuz-3.13.0-32-generic
[/output]
Here's the real problem I think:
[As user, not root, from the home directory]
mark@server1:~/.ssh$ ll
ls: cannot open directory .: Permission denied
mark@server1:~/.ssh$ cd ..
mark@server1:~$ ll
total 36
drwxr-xr-x 4 mark mark 4096 Aug 6 19:26 ./
drwxr-xr-x 4 root root 4096 Aug 9 00:24 ../
-rw------- 1 mark mark 5888 Aug 8 14:11 .bash_history
-rw-r--r-- 1 mark mark 220 Aug 3 10:00 .bash_logout
-rw-r--r-- 1 mark mark 3637 Aug 3 10:00 .bashrc
drwx------ 2 mark mark 4096 Aug 3 10:03 .cache/
-rw-r--r-- 1 mark mark 675 Aug 3 10:00 .profile
drwx------ 2 700 mark 4096 Aug 6 19:26 .ssh/
mark@server1:~$
[/output]
Somehow I have the owner of the .ssh directory as 700! As mark, I can not access this folder. I want to got back to the correct ownership of these directories. Next time I'll be more careful to use chmod instead of chown.
[root directory]
root@server1:/# ll
total 80
drwxr-xr-x 21 root root 4096 Aug 3 09:46 ./
drwxr-xr-x 21 root root 4096 Aug 3 09:46 ../
drwxr-xr-x 2 root root 4096 Aug 3 09:54 bin/
drwxr-xr-x 3 root root 4096 Aug 3 10:00 boot/
drwxr-xr-x 13 root root 4120 Aug 8 07:43 dev/
drwxr-xr-x 90 root root 4096 Aug 9 00:23 etc/
drwxr-xr-x 4 root root 4096 Aug 9 00:24 home/
lrwxrwxrwx 1 root root 33 Aug 3 09:46 initrd.img -> boot/initrd.img-3.13.0-32-generic
drwxr-xr-x 21 root root 4096 Aug 3 09:54 lib/
drwx------ 2 root root 16384 Aug 3 09:43 lost+found/
drwxr-xr-x 6 root root 4096 Aug 7 04:38 media/
drwxr-xr-x 3 root root 4096 Aug 6 19:44 mnt/
drwxr-xr-x 2 root root 4096 Jul 22 17:48 opt/
dr-xr-xr-x 84 root root 0 Aug 8 07:42 proc/
drwx------ 2 root root 4096 Aug 3 10:22 root/
drwxr-xr-x 18 root root 640 Aug 8 23:48 run/
drwxr-xr-x 2 root root 4096 Aug 3 10:01 sbin/
drwxr-xr-x 2 root root 4096 Jul 22 17:48 srv/
dr-xr-xr-x 13 root root 0 Aug 8 07:42 sys/
drwxrwxrwt 3 root root 4096 Aug 9 00:33 tmp/
drwxr-xr-x 10 root root 4096 Aug 3 09:43 usr/
drwxr-xr-x 12 root root 4096 Aug 3 09:56 var/
lrwxrwxrwx 1 root root 30 Aug 3 09:46 vmlinuz -> boot/vmlinuz-3.13.0-32-generic
[/output]
Here's the real problem I think:
[As user, not root, from the home directory]
mark@server1:~/.ssh$ ll
ls: cannot open directory .: Permission denied
mark@server1:~/.ssh$ cd ..
mark@server1:~$ ll
total 36
drwxr-xr-x 4 mark mark 4096 Aug 6 19:26 ./
drwxr-xr-x 4 root root 4096 Aug 9 00:24 ../
-rw------- 1 mark mark 5888 Aug 8 14:11 .bash_history
-rw-r--r-- 1 mark mark 220 Aug 3 10:00 .bash_logout
-rw-r--r-- 1 mark mark 3637 Aug 3 10:00 .bashrc
drwx------ 2 mark mark 4096 Aug 3 10:03 .cache/
-rw-r--r-- 1 mark mark 675 Aug 3 10:00 .profile
drwx------ 2 700 mark 4096 Aug 6 19:26 .ssh/
mark@server1:~$
[/output]
Somehow I have the owner of the .ssh directory as 700! As mark, I can not access this folder. I want to got back to the correct ownership of these directories. Next time I'll be more careful to use chmod instead of chown.
Comment