Is #chmod o-w /usr safe?

Forum rules
Before you post please read how to get help

Is #chmod o-w /usr safe?

Postby Wiz Kid on Tue Oct 23, 2012 12:00 am

I was trying to set up a VM in virtualbox and a forum said to run this command
Code: Select all
#chmod o-w /usr
But is it safe or should I undo it, because in the end it was not what solved the problem. I don't want to run an insecure box. All I know is that I gave write permissions to that folder, but I don't know if that is very unsafe to do?

And can someone please post the undo command as well, Thanks.
Mint/Ubuntu Wireless Cards Supported HOW TO FIX: https://help.ubuntu.com/community/WifiD ... nufacturer

The Linux Beginners Search Engine. TRY THIS!! http://home.windstream.net/joelwest/
User avatar
Wiz Kid
Level 1
Level 1
 
Posts: 37
Joined: Wed Sep 12, 2012 11:01 pm

Linux Mint is funded by ads and donations.
 

Re: Is #chmod o-w /usr safe?

Postby bkidwell on Tue Oct 23, 2012 12:53 am

So my /usr folder is owned by root:root with 755 permissions you likely have the same with that command. If you drop to / and run
Code: Select all
ls -l
look for /usr and it should say something like
drwxr-xr-x 11 root root 4096 Sep 26 09:38 usr

If not you can set it to that with this.
Code: Select all
sudo chmod 755 /usr


The "o" symobilizes the last three letters of the 10, meaning other people besides the OWNER,(in this case root) and GROUP (also root).
The "-w" means remove write privilages, but as far as I can tell, that is the default anyway. So it's likely that command did not change any thing.
However if it was a "+w" then it made the folder open to be added too and deleted from by any user.
bkidwell
Level 1
Level 1
 
Posts: 16
Joined: Sun Jul 08, 2012 10:52 am

Re: Is #chmod o-w /usr safe?

Postby Wiz Kid on Tue Oct 23, 2012 1:52 am

I found i used "-w" after I looked at the log so everything seems to check out. Here's the result. Thanks for your time, much appreciated.

Code: Select all
abc@pc ~ $ cd /
abc@pc / $ ls -l
total 104
drwxr-xr-x   2 root root 12288 Oct 20 19:49 bin
drwxr-xr-x   3 root root  4096 Oct 20 19:59 boot
drwxr-xr-x  15 root root  4280 Oct 22 23:53 dev
drwxr-xr-x 138 root root 12288 Oct 23 01:23 etc
drwxr-xr-x   3 root root  4096 Sep 12 21:22 home
lrwxrwxrwx   1 root root    32 Sep 12 21:24 initrd.img -> boot/initrd.img-3.2.0-23-generic
lrwxrwxrwx   1 root root    33 Sep 12 21:14 initrd.img.old -> /boot/initrd.img-3.2.0-23-generic
drwxr-xr-x  24 root root  4096 Oct 20 19:49 lib
drwxr-xr-x   2 root root  4096 Oct 20 19:49 lib64
drwx------   2 root root 16384 Sep 12 21:13 lost+found
drwxr-xr-x   3 root root  4096 Oct 23 01:23 media
drwxr-xr-x   2 root root  4096 Apr 19  2012 mnt
drwxr-xr-x   7 root root  4096 Sep 13 02:06 opt
dr-xr-xr-x 158 root root     0 Oct 22 23:52 proc
drwx------  13 root root  4096 Sep 13 02:01 root
drwxr-xr-x  24 root root   820 Oct 22 23:54 run
drwxr-xr-x   2 root root  4096 Oct 20 19:56 sbin
drwxr-xr-x   2 root root  4096 Mar  5  2012 selinux
drwxr-xr-x   2 root root  4096 Apr 23  2012 srv
drwxr-xr-x  13 root root     0 Oct 22 23:52 sys
drwxrwxrwt  15 root root 12288 Oct 23 01:17 tmp
drwxr-xr-x  10 root root  4096 Apr 23  2012 usr
drwxr-xr-x  12 root root  4096 Oct 22 23:49 var
lrwxrwxrwx   1 root root    29 Sep 12 21:24 vmlinuz -> boot/vmlinuz-3.2.0-23-generic
Mint/Ubuntu Wireless Cards Supported HOW TO FIX: https://help.ubuntu.com/community/WifiD ... nufacturer

The Linux Beginners Search Engine. TRY THIS!! http://home.windstream.net/joelwest/
User avatar
Wiz Kid
Level 1
Level 1
 
Posts: 37
Joined: Wed Sep 12, 2012 11:01 pm


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 2 guests