DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2012-06-07 04:58:27

jm2012
Member
Registered: 2012-05-27
Posts: 15

Mistakenly chown'd all files to nobody:allaccount - any fix?

I entered the following command by mistake:

Code:

chown nobody:allaccount /./

I was trying to change the ownership of the files in the current directory, but I added a leading slash by mistake.  I realized something was wrong when the command took forever to end, so I pressed ctrl+C (in a Putty SSH terminal) to stop it.  Unfortunately, on listing the contents of the NAS, I see that many files in important system folders have had their ownership changed.

Some of the directories that were changed to nobody:allaccount include: /bin, /lost+found, /dev, /etc, /lib, /home, /mnt/web_page, and /mnt/HD/HD_a2/, including /mnt/HD/HD_a2/ffp.

Directories that are still root:root include: /proc, /usr, /sbin, /sys, /tmp and /var.

Can I just change some of the directories back to root:root using chown?  Which should I change back?  Thanks for any advice - the device is a DNS-325, but this subforum seems more active, so I've posted it here.  I hope no one minds.

Last edited by jm2012 (2012-06-07 06:49:40)

Offline

 

#2 2012-06-07 06:30:14

rac8006
Member
Registered: 2010-10-15
Posts: 13

Re: Mistakenly chown'd all files to nobody:allaccount - any fix?

If you reboot doesn't the files go back to root:root.  with the exception of the file on the /mnt/HD_a2.

RAC

Offline

 

#3 2012-06-09 00:55:17

jm2012
Member
Registered: 2012-05-27
Posts: 15

Re: Mistakenly chown'd all files to nobody:allaccount - any fix?

Thanks, RAC, that's good to know.  Can anyone confirm that what RAC posted is also true for the DNS-325?

Or, if possible, can someone please run the following command and send me the perms.log file the command outputs?

Command:

Code:

find /bin /lost+found /dev /etc /lib /home /mnt/web_page /proc /usr /sbin /sys /tmp /var -printf "chown %u:%g \"%p\"\n" > /mnt/HD/HD_a2/perms2.log

The command lists the ownership information for all files in the listed directories (/bin /lost+found /dev /etc /lib /home /mnt/web_page /proc /usr /sbin /sys /tmp /var) in the following form:

chown root:root "/var/www/cgi-bin/status_mgr.cgi"

The results of the command on my device are available at this link.  Before uploading, please review the output to make sure you aren't disclosing any sensitive information.  I don't think there are any user files in these directories, but I could be wrong.  Also, note that this command lists the name rather than the ID number of accounts and account groups.

Thanks very much for any help!  I'm nervous that my device will freeze up on boot, so I really want to see what the ownership attributes are for a properly configured device.

Offline

 

#4 2012-06-09 01:17:50

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: Mistakenly chown'd all files to nobody:allaccount - any fix?

This how booting works (kindof).

All the folder you list above reside in RAM memory. They are loaded there from the ramdisk image which is stored as compressed file on flash memory.

You can see this by running the mount command + google what you see.

Last edited by bjby (2012-06-09 01:20:52)

Offline

 

#5 2012-06-19 05:43:10

jm2012
Member
Registered: 2012-05-27
Posts: 15

Re: Mistakenly chown'd all files to nobody:allaccount - any fix?

You were right guys, thanks for your help!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB