OS File Permissions (dumb error)


Edrikk

Recommended Posts

Hi,

 

This morning I was in a rush, and manually ran a shell script which changes permissions, based on input parameters which make up the path and file name. 

 

Accidentally, I didn't give input parameters (early morning rush, etc).  Since there was no parameters, the script basically started recursively changing ownership and permissions from /.

 

As soon as I noticed this I killed the script, but it was too late.

 

It appears that the permissions on OS file such as bash (sh) were changed, and I can't execute anything as root.  In fact, I had to go to work, and I fact SSHing into the box fails (post authentication) with an "/bin/sh permission denied" error.

 

I copied the contents of the "flash" directory from the USB (as SMB still works), in case recovery will be "involved".

 

The Web interface also doesn't load any longer.  :/

 

My questions are:

 

1). Since I'm at work, I can't try this till later tonight, but would a hard reboot of the box reset the permissions?  (I don't believe the actual OS files are static and the ram disk is flushed, resetting the permissions if I'm not mistaking).

 

2). If I'm wrong on "1" any other suggestions?

 

 

Running 6.1.4

 

Thanks so much.

 

 

Moral of story:  don't do things in a rush.

 

Felt so dumb driving to work.  :(

 

Link to comment

A hard reboot will reset the permissions on all the core OS related files.  It will, however, start a parity check since you have just done an unclean shutdown, although you can then cancel that.

 

After that it is likely that you will have to run Tools->New Permissions to reset the permissions on any files on the array data disks.

 

Not sure if there are any other actions that will need taking, but it nothing obvious springs to mind.

Link to comment

1). Since I'm at work, I can't try this till later tonight, but would a hard reboot of the box reset the permissions?  (I don't believe the actual OS files are static and the ram disk is flushed, resetting the permissions if I'm not mistaking).

This is correct, the OS is unpacked fresh from the flash drive each boot. The files unpacked from flash (the OS) will not be affected.

 

However, since you started at /, /boot and /mnt might also have been affected.

 

/boot is the files on flash, possibly including bzroot,bzimage which contains the OS archive. You can probably chown root:root and chmod 777 these if needed.

 

/mnt has the disks and shares. New Permissions can probably fix most of this for you.

Link to comment

Thanks folks.

 

It's good to see at least that my recollection was correct (searching wasn't bringing up what I remembered reading).

 

As long as I can ssh into the box, the rest will be alright, so it's great to see that a reboot should bring it up.

 

Will provide an update later tonight (12 hours probably).

 

 

Thanks so much!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.