LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Totally messed up the user permissions.*want to cry* (https://www.linuxquestions.org/questions/slackware-14/totally-messed-up-the-user-permissions-%2Awant-to-cry%2A-580876/)

hottdogg 08-30-2007 02:33 AM

Totally messed up the user permissions.*want to cry*
 
Hi all,

i need help.
:cry::cry:
i've done something stupid cause of my ignorance.
Im' not too familiar with chmod and did something stupid invoked
this:
Code:

#chmod -R 766 /DATA *
in / directory.
actually i wanted to make this happen inside /DATA (my own partition) only but you know the rest...
anyway, in the middle i pressed ctrl-c so not all directories changed.
but some like /bin,/boot, have changed :( :( :(

currently,my
fallback is just chmode -Rv 755 for directories that seems have been affected.
is that good enough?

and now after exit su and want to su again, i get this error:
Code:

setgid: Operation not permitted
Should i reinstall?

tommcd 08-30-2007 03:50 AM

I'm not sure how to correct you problem, but if your /DATA partition is just for your personal files, and you just want to get read and write permission to /DATA as a regular user, then in the future just do "chown -R your_user_name:users /DATA" will do it.
I have a /data partition for my personal data because I have several distros on my PCs and want to keep the config files that are stored in /home separate from each other so that is how I do it.

b0uncer 08-30-2007 04:11 AM

I see two choices here, one is to have a (working) Linux from which to check the working permissions on the directories and then chmod them to your own machine's equivalents, and the other is to reinstall. If you have a separate /home, have backed your data up or don't have anything to back up, it's definitely easiest done if you reinstall. If you haven't got a separate /home (if you did, you could reinstall without losing personal data), back up at least your /home and possible other important data, and boot from Slackware install disc.

This is a good example why people should not use commands with root privileges without thinking first, and preferrably using interactive mode (question per target, yes/no).

bathory 08-30-2007 04:19 AM

Take a look at this post and the link provided to see if it can help you to avoid reinstalling.

Good luck

gnashley 08-30-2007 12:10 PM

Here's the script in question if not still avaliable:
Code:

#!/bin/sh
#smprms
#Create a script to restore the filesystem permissions from the MANIFEST (stdin)
#

about_text='
# Author:  Cameron Kerr
# Email:    cameron.kerr@paradise.net.nz
# Website:  http://homepages.paradise.net.nz/~cameronk/
# Version:  27 August 2001'

if [ $# -ne 0 ]; then
  echo "USAGE: zcat MANIFEST.gz | `basename $0` > /tmp/longscript.sh" >&2
  echo "      su - (if not root already)" >&2
  echo "      /tmp/longscript.sh" >&2
  exit 255
fi 

echo "#!/bin/sh"
echo "#This script was generated by `basename $0` from a Slackware MANIFEST.gz"
echo "#It will restore permissions to all files listed in the MANIFEST.gz,"
echo "#even files not there, so you might like to filter out 'not found'"
echo "#messages"
echo "#"
echo "#About the generator ${about_text}"

cat | sed -e '
/^++==*/d
/^||/d
/^ *$/d
/^[-dlcbps]/{
  s/^\(.*\) \(.*\)\/\(.*[^ ]\)  *.* .* .*  *\(.*\)$/\
chown \2.\3 \/\4\
chmod PERM\1PERM \/\4/
  /PERM.*PERM/{
    s/PERM.\(...\)\(...\)\(...\)PERM/u=PERM\1PERM,g=PERM\2PERM,o=PERM\3PERM/
  }
  /PERM.*[^ ]PERM/{
    s/-//g
  }
  s/PERM//g
}
'

If your MANIFEST is a .bz2 file you can change the 'zcat' above to 'bzcat' and make it work. Be sure to cd into the directory where the MANIFEST is or give the full path.

hottdogg 08-30-2007 11:16 PM

Dear moderator,
sorry for the double threads, it seems i clicked twice when submitting yesterday.Too nervous ;)

Hello guys,
thanks for the replies!
using MANIFESTO.gz and the smprms script from ,IIRC,linuxangel site quite working well :) didn't know what MANIFESTO.gz was all about until now... :D
tnx,tnx,tnx !
my su is working, sound is working. At least my slackware more usable now.
But, i don't trust my own system anymore cause of my own action .lol.. and i have
some unofficial pkg installed that probably have changed in yesterday disaster and not covered by MANIFESTO.gz .
so, now i have the reason to fresh install slackware 12.0 sometime soon! :D
won't forget to backup my data ofcourse.

oh yeah,b0uncer i think you know what i was trying before this mess-up ;) you're the only one that reply in my other thread
I will update that thread after trying MORE carefully.
This is why i like about slackware and the community.Dependable most of the time..:D

PDock 08-31-2007 05:00 AM

Before reinstall might want to
Code:

man upgradepkg
.
As in from your source subdirectories
Code:

upgradepkg --reinstall *.tgz
yea there is a way to make it recursive but didn't


All times are GMT -5. The time now is 03:40 AM.