You are not logged in.

#1 2013-01-16 02:03:06

phil
Member
Registered: 2012-09-22
Posts: 72

[SOLVED]Did "sudo chmod 600 / "

Hi,

I just did the command "sudo chmod 600 / ".
I had a arch stick. So I booted, mounted the partition and did a "sudo chmod 777 / ". But I guess this is not as it should be right?
What do I have to do to make my system safe and stable again? I only have to check the folders and files in / and not subfolders?

caesium ~ $ ls -al / 
total 69
drwxrwxrwx  20 root root  4096 Jan  9 11:29 .
drwxrwxrwx  20 root root  4096 Jan  9 11:29 ..
drwxr-xr-x   2 root root  4096 Jan 15 13:09 bin
drwxr-xr-x   4 root root  1024 Jan  7 00:26 boot
drwxr-xr-x  18 root root  3360 Jan 15 21:12 dev
drwxr-xr-x  71 root root  4096 Jan 15 20:15 etc
drwxr-xr-x   4 root root  4096 Jan  7 00:43 home
lrwxrwxrwx   1 root root     7 Dec 26 05:23 lib -> usr/lib
lrwxrwxrwx   1 root root     7 Dec 26 05:23 lib64 -> usr/lib
drwx------   2 root root 16384 Jan  7 00:17 lost+found
drwxr-xr-x   2 root root  4096 Jan 10 08:50 media
drwxr-xr-x   2 root root  4096 Dec  3 20:02 mnt
drwxr-xr-x   4 root root  4096 Jan 15 09:43 opt
dr-xr-xr-x 120 root root     0 Jan 15 20:59 proc
drwxr-x---   5 root root  4096 Jan  8 00:11 root
drwxr-xr-x  21 root root   520 Jan 15 21:12 run
drwxr-xr-x   2 root root  4096 Jan 15 13:09 sbin
drwxr-xr-x   4 root root  4096 Dec  3 20:02 srv
dr-xr-xr-x  13 root root     0 Jan 15 20:59 sys
drwxrwxrwt  13 root root   320 Jan 15 21:19 tmp
drwxr-xr-x  10 root root  4096 Jan  8 10:09 usr
drwxr-xr-x  13 root root  4096 Jan  9 13:50 var

Cheers


EDIT: Followed this thread https://bbs.archlinux.org/viewtopic.php?id=14564 . Hope this is it... any further ideas?

Last edited by phil (2013-01-16 13:04:51)

Offline

#2 2013-01-16 02:29:17

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: [SOLVED]Did "sudo chmod 600 / "

You didn't pass any options to chmod, right? Especially not e.g. -r?

As long as not, you should only need to worry about the top directory. It should look something like this:

drwxr-xr-x   22 root root   4096 Rha  28 23:33 ./
drwxr-xr-x   22 root root   4096 Rha  28 23:33 ../
-rw-------    1 root root    382 Rha   2  2011 .bash_history
drwxr-xr-x    2 root root   4096 Rha   7  2011 .config/
drwxr-xr-x    2 root root   4096 Ion  15 21:37 bin/
drwxr-xr-x    6 root root   4096 Ion   5 00:31 boot/
drwxr-xr-x    6 root root   4096 Maw  18  2012 boot.bkup/
-rw-------    1 root root 253828 Ion  14 22:49 dead.letter
drwxr-xr-x   19 root root   3320 Ion  15 22:56 dev/
drwxr-xr-x  126 root root  12288 Ion  16 00:33 etc/
drwxr-xr-x    7 root root   4096 Tach  7 21:14 home/
lrwxrwxrwx    1 root root      7 Rha  26 10:23 lib -> usr/lib/
lrwxrwxrwx    1 root root      7 Rha  26 10:23 lib64 -> usr/lib/
drwx------    2 root root  16384 Tach  9 16:24 lost+found/
drwxr-xr-x    2 root root   4096 Ion   9 00:43 media/
drwxr-x---+   8 root root   4096 Tach 11 01:24 mnt/
drwxr-xr-x    7 root root   4096 Ion  15 22:04 opt/
dr-xr-xr-x  217 root root      0 Ion  14 22:48 proc/
drwxr-x---   23 root root   4096 Ion  16 00:25 root/
drwxr-xr-x   28 root root    780 Ion  16 02:01 run/
drwxr-xr-x    2 root root   4096 Ion  15 21:37 sbin/
drwxr-xr-x    4 root root   4096 Rha   4 01:02 srv/
dr-xr-xr-x   13 root root      0 Ion  14 22:48 sys/
drwxrwxrwt   18 root root    400 Ion  16 02:07 tmp/
drwxr-xr-x   11 root root   4096 Ebr  28  2012 usr/
drwxr-xr-x   16 root root   4096 Rha   6 02:40 var/

Obviously yours will not look identical e.g. you probably don't have boot.bkup at all. But this should give you an idea.

Note that you definitely do not want / to be world writeable which yours is at the moment!

Last edited by cfr (2013-01-16 02:30:51)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-01-16 02:34:58

phil
Member
Registered: 2012-09-22
Posts: 72

Re: [SOLVED]Did "sudo chmod 600 / "

What do the words and numbers in front of all the folders mean?
Update: after chmod 755 / it looks like this:


caesium ~ $ ls -al /
total 69
drwxr-xr-x  20 root root  4096 Jan 15 21:25 .
drwxr-xr-x  20 root root  4096 Jan 15 21:25 ..
drwxr-xr-x   2 root root  4096 Jan 15 13:09 bin
drwxr-xr-x   4 root root  1024 Jan  7 00:26 boot
drwxr-xr-x  18 root root  3360 Jan 15 21:31 dev
drwxr-xr-x  71 root root  4096 Jan 15 20:15 etc
drwxr-xr-x   4 root root  4096 Jan  7 00:43 home
lrwxrwxrwx   1 root root     7 Dec 26 05:23 lib -> usr/lib
lrwxrwxrwx   1 root root     7 Dec 26 05:23 lib64 -> usr/lib
drwx------   2 root root 16384 Jan  7 00:17 lost+found
drwxr-xr-x   2 root root  4096 Jan 10 08:50 media
drwxr-xr-x   2 root root  4096 Dec  3 20:02 mnt
drwxr-xr-x   4 root root  4096 Jan 15 09:43 opt
dr-xr-xr-x 126 root root     0 Jan 15 21:31 proc
drwxr-x---   5 root root  4096 Jan  8 00:11 root
drwxr-xr-x  20 root root   480 Jan 15 21:33 run
drwxr-xr-x   2 root root  4096 Jan 15 13:09 sbin
drwxr-xr-x   4 root root  4096 Dec  3 20:02 srv
dr-xr-xr-x  13 root root     0 Jan 15 21:31 sys
drwxrwxrwt  13 root root   320 Jan 15 21:33 tmp
drwxr-xr-x  10 root root  4096 Jan  8 10:09 usr
drwxr-xr-x  13 root root  4096 Jan  9 13:50 var

Last edited by phil (2013-01-16 02:37:18)

Offline

#4 2013-01-16 02:40:32

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: [SOLVED]Did "sudo chmod 600 / "

Your mnt is also different but I'm less sure about that. I have an ACL on mnt:

$ getfacl /mnt/
getfacl: Removing leading '/' from absolute path names
# file: mnt/
# owner: root
# group: root
user::rwx
group::r-x
group:users:r-x
mask::r-x
other::---

But I'm not sure if this is something which depends on what you are using to manage mounts so I don't know if you should change it or not.

One thing you could do is reinstall the filesystem package. That includes the /mnt directory and hopefully is will correct or report any issues.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-01-16 02:49:57

phil
Member
Registered: 2012-09-22
Posts: 72

Re: [SOLVED]Did "sudo chmod 600 / "

Nothing changed after reinstalling filesystem.
Maybe I should reinstall a lot of packages?
Could you explain me what all the number mean in a line like:

drwxr-xr-x   2 root root  4096 Dec  3 20:02 mnt

rights, ... , owner (but why two times root), ... , last change, folder


But does that mean that the last change to /mnt was made on Dec 3?


This is from my last install, I have it on an external drive:


ls -al
total 240
drwxr-xr-x  20 root root 61440 Jan  7 12:53 .
drwxr-x---+  3 root root    60 Jan 15 21:51 ..
drwxr-xr-x   2 root root  4096 Jan  5 11:17 bin
drwxr-xr-x   2 root root  4096 Sep 24 22:47 boot
drwxr-xr-x   2 root root  4096 Sep 24 22:48 dev
drwxr-xr-x  75 root root  4096 Jan  7 16:08 etc
drwxr-xr-x   2 root root  4096 Sep 24 22:47 home
lrwxrwxrwx   1 root root     7 Dec 26 05:23 lib -> usr/lib
lrwxrwxrwx   1 root root     7 Dec 26 05:23 lib64 -> usr/lib
-rw-r--r--   1 root root   249 Jan  6 20:58 locale.conf
drwx------   2 root root 16384 Sep 24 22:44 lost+found
drwxr-xr-x   2 root root  4096 Dec 30 20:45 media
drwxr-xr-x   5 root root  4096 Nov  7 14:54 mnt
drwxr-xr-x   5 root root  4096 Jan  4 10:49 opt
drwxr-xr-x   2 root root  4096 Sep 24 22:48 proc
-rw-r--r--   1 root root 84199 Jan  7 12:53 .readahead
drwxr-x---  12 root root  4096 Dec 16 15:23 root
drwxr-xr-x   2 root root  4096 Sep 24 22:48 run
drwxr-xr-x   2 root root  4096 Jan  2 21:57 sbin
drwxr-xr-x   4 root root  4096 Dec  5 11:30 srv
drwxr-xr-x   2 root root  4096 Sep 24 22:48 sys
drwxr-xr-x   2 root root  4096 Sep 24 23:43 tmp
drwxr-xr-x  10 root root  4096 Sep 25 03:55 usr
drwxr-xr-x  13 root root  4096 Dec  5 11:30 var

Last edited by phil (2013-01-16 02:55:32)

Offline

#6 2013-01-16 03:31:52

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Offline

#7 2013-01-16 03:58:18

phil
Member
Registered: 2012-09-22
Posts: 72

Re: [SOLVED]Did "sudo chmod 600 / "

Thanks! Maybe some people could post their output of

ls -al /

so we can compare a little bit. But I think my filesystem should be fine again.

Thank you all!

Offline

#8 2013-01-16 07:45:56

HungGarTiger
Member
From: nz/auckland/
Registered: 2012-06-27
Posts: 187

Re: [SOLVED]Did "sudo chmod 600 / "

phil wrote:

Thanks! Maybe some people could post their output of

ls -al /

so we can compare a little bit. But I think my filesystem should be fine again.

Thank you all!

Don't forget to mark your thread as solved, as to help others identify where they might find an answer to their (similar) problems.


"No sympathy for the devil. If you buy the ticket, take the ride."
- Hunter S. Thompson

Offline

#9 2013-01-16 13:06:18

phil
Member
Registered: 2012-09-22
Posts: 72

Re: [SOLVED]Did "sudo chmod 600 / "

Is it really solved? I mean my system is up and running again, which is great! But there are still some differences, so I would like to compare to more other intallations.

Offline

#10 2013-01-16 13:08:00

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [SOLVED]Did "sudo chmod 600 / "

$ ls -l /
total 61K
drwxr-xr-x   2 root root  4K Jan 16 11:29 bin
drwxr-xr-x   4 root root  1K Jan  7 10:39 boot
drwxr-xr-x  17 root root  4K Jan 16 11:23 dev
drwxr-xr-x  89 root root  4K Jan 16 11:33 etc
drwxr-xr-x   6 root root  4K Oct  5  2011 home
lrwxrwxrwx   1 root root  1K Dec 26 11:23 lib -> usr/lib
lrwxrwxrwx   1 root root  1K Dec 26 11:23 lib64 -> usr/lib
drwx------   2 root root 16K Jun 28  2011 lost+found
drwxr-xr-x   3 root root  4K Dec 19 10:19 media
drwxr-xr-x   2 root root  4K Dec  4 02:02 mnt
drwxr-xr-x   5 root root  4K Jan 16 11:32 opt
dr-xr-xr-x 160 root root  0K Jan 14 10:24 proc
drwxr-x---  15 root root  4K Nov  8 14:19 root
drwxr-xr-x  24 root root  1K Jan 16 11:00 run
drwxr-xr-x   2 root root  4K Jan 16 11:29 sbin
drwxr-xr-x   4 root root  4K Dec  4 02:02 srv
dr-xr-xr-x  13 root root  0K Jan 14 10:24 sys
drwxrwxrwt  23 root root  1K Jan 16 13:58 tmp
drwxr-xr-x  10 root root  4K Jan 15 14:42 usr
drwxr-xr-x  15 root root  4K Dec 10 10:52 var

Offline

#11 2013-01-16 13:43:31

HungGarTiger
Member
From: nz/auckland/
Registered: 2012-06-27
Posts: 187

Re: [SOLVED]Did "sudo chmod 600 / "

ls -al /
total 72
drwxr-xr-x  20 root root  4096 Dec 29 20:35 .
drwxr-xr-x  20 root root  4096 Dec 29 20:35 ..
drwxr-xr-x   2 root root  4096 Jan 16 17:40 bin
drwxr-xr-x   4 root root  4096 Jan  4 09:38 boot
drwxr-xr-x  19 root root  3080 Jan 16 10:14 dev
drwxr-xr-x  73 root root  4096 Jan 16 17:40 etc
drwxr-xr-x   4 root root  4096 Jul  2  2012 home
lrwxrwxrwx   1 root root     7 Dec 26 18:53 lib -> usr/lib
drwx------   2 root root 16384 Jul  2  2012 lost+found
drwxr-xr-x   3 root root  4096 Jul  5  2012 media
drwxr-xr-x   2 root root  4096 Dec  4 09:02 mnt
drwxr-xr-x   3 root root  4096 Nov 29 18:41 opt
dr-xr-xr-x 121 root root     0 Jan 16 10:10 proc
drwxr-x---   7 root root  4096 Jan 12 22:12 root
drwxr-xr-x  23 root root   580 Jan 16 15:31 run
drwxr-xr-x   2 root root  4096 Jan 16 17:40 sbin
drwxr-xr-x   4 root root  4096 Dec  4 09:02 srv
dr-xr-xr-x  12 root root     0 Jan 16 10:10 sys
drwxrwxrwt  11 root root   260 Jan 16 21:41 tmp
drwxr-xr-x   9 root root  4096 Dec  6 12:33 usr
drwxr-xr-x  13 root root  4096 Dec  6 12:33 var

"No sympathy for the devil. If you buy the ticket, take the ride."
- Hunter S. Thompson

Offline

Board footer

Powered by FluxBB