Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: HomePlayer on June 10, 2008, 12:23:03 PM

Title: chown admin:root /home
Post by: HomePlayer on June 10, 2008, 12:23:03 PM
Oops,

Help needed.

i needed to chown some files in /home/e-smith/files/users/admin/home/
i was working in this dir  /home/e-smith/files/users/admin

so i did a chown -R admin:root /home
Stupid me it had to bin "chown -R admin:root /home/e-smith/files/users/admin/home"

and now it happend, all files and dir's in the root /home got admin:root

I needed only the files and dir's in /home/e-smith/files/users/admin

pls is a reinstall the only option or can some things be fixed...

If a reinstall is needed.
- can I use one of my raid disks (stop it from being in the raid, format it ext3, and copy data to it)
- Unplug this HD, reinstall SME 7.3 on the anther disk - configure sme users ibays.
- Power-off plug in the backup HD, power on mount copy and most likely chown some file's
- check recheck every thing, and build the raid.
Title: Re: chown admin:root /home
Post by: cactus on June 10, 2008, 06:53:17 PM
i needed to chown some files in /home/e-smith/files/users/admin/home/
i was working in this dir  /home/e-smith/files/users/admin
I hope your cat was walking across your keyboard and that you did not make the mistake yourself... I keep wondering why people keep chown-ing files so carelessly?

Most of the /home/e-smith tree should be root:root AFAIK, with the only exception being the user home drives they should be user:user for each individual user, but I remember some folders being set to admin:admin as well.

Mind you this is a rough sketch as I am not sure if they fully cover all permissions and exceptions...
Title: Re: chown admin:root /home
Post by: HomePlayer on June 10, 2008, 07:49:14 PM
your correct indeed,
nope there was not a cat, of any kind.

well i am seting up a VM machine to find the right settings. I think it is easyer to set it back, instad of reinstall.

I keep wondering why people keep chown-ing files so carelessly?
To bad that you dont give a tip to avoid things like this
Title: Re: chown admin:root /home
Post by: cactus on June 10, 2008, 08:00:35 PM
well i am seting up a VM machine to find the right settings. I think it is easyer to set it back, instad of reinstall.
That might be the quickest solution, but be carefull not to make a typo again ;-)

To bad that you dont give a tip to avoid things like this
I don't know of any tips preventing this, but I have used it very rarely the last five SME Server years. Furthermore I always  check and double check such syntaxes when issuing such commands on other systems, especially when I am setting them recursively. Most of the times I navigate to the top level of the tree I want to chmod/chown to prevent mistakes propagating down the tree like in your case. Perhaps another option is to use midnight commander for such tasks.

Hopefully you may find help in the tips above.
Title: Re: chown admin:root /home
Post by: CharlieBrady on June 10, 2008, 10:49:22 PM
To bad that you dont give a tip to avoid things like this

Actually, the fully functional server manager is provided so that users don't ever need to chown anything.
Title: Re: chown admin:root /home
Post by: CharlieBrady on June 10, 2008, 10:50:23 PM
i needed to chown some files in /home/e-smith/files/users/admin/home/

Why?
Title: Re: chown admin:root /home
Post by: cactus on June 10, 2008, 10:56:46 PM
Actually, the fully functional server manager is provided so that users don't ever need to chown anything.
I know :-), that is why I (almost) never need to do modification like such on the CLI.
Title: Re: chown admin:root /home
Post by: HomePlayer on June 11, 2008, 08:20:10 AM
I navigate to the top level of the tree I want to chmod/chown to prevent mistakes propagating down the tree like in your case. Perhaps another option is to use midnight commander for such tasks.

Hopefully you may find help in the tips above.
good one,

i had to chown some files, els i good not get to them, wrong permision. it got late last nite working from home to set things back.
I'll be of to work now. to see if i got all things write ;-)

thanks for all the replays
Title: Re: chown admin:root /home
Post by: 7eis on June 16, 2008, 09:50:48 PM
If you need to do this on a regular basis (same dirs of cause), just throw them lines into a file in your homedir and chmod is a+x. then issue ./chmodninjascript.

Works for me. Hope you solved your problem - make sure to document everything! :-)
Title: Re: chown admin:root /home
Post by: HomePlayer on June 17, 2008, 09:47:25 AM
yeah, thanks 7Eis, thats a very smart idea indeed
Title: Re: chown admin:root /home
Post by: cactus on June 17, 2008, 06:39:53 PM
If you need to do this on a regular basis (same dirs of cause)
Then you are doing something wrong as you should rarely, if not never, need these sort of commands on SME Server as Charlie already stated earlier in this thread (http://forums.contribs.org/index.php?topic=41251.msg192209#msg192209).
Perhaps you could elaborate on why you need these commands for the same set of files and/or folders on a regular basis.
Title: Re: chown admin:root /home
Post by: HomePlayer on June 19, 2008, 03:29:03 PM
Oke Catus,

whit putty i did copy a dir from one of the user/home dirs to admin/home from windows i could not get into this dir user1:user1