LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-30-2007, 02:33 AM   #1
hottdogg
Member
 
Registered: Aug 2004
Distribution: opensuse ,debian/ubuntu
Posts: 222

Rep: Reputation: 30
Totally messed up the user permissions.*want to cry*


Hi all,

i need help.

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?
 
Old 08-30-2007, 03:50 AM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
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.

Last edited by tommcd; 08-30-2007 at 03:51 AM.
 
Old 08-30-2007, 04:11 AM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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).
 
Old 08-30-2007, 04:19 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

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

Good luck
 
Old 08-30-2007, 12:10 PM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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.
 
Old 08-30-2007, 11:16 PM   #6
hottdogg
Member
 
Registered: Aug 2004
Distribution: opensuse ,debian/ubuntu
Posts: 222

Original Poster
Rep: Reputation: 30
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...
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!
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..
 
Old 08-31-2007, 05:00 AM   #7
PDock
Member
 
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 37
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Totally whacked permissions! raid517 Linux - Software 1 06-04-2005 06:26 AM
X hangs at startup, permissions for normal user messed up. elgatofilo Slackware 5 12-20-2004 08:48 PM
sound totally messed up djlosch Linux - Hardware 8 09-02-2004 09:24 PM
Messed up my permissions usercsr Slackware 7 07-08-2004 11:21 AM
GRUB is totally messed up! is blaster to blame randyriver10 Linux - Software 6 03-22-2004 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration