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

Notices


Reply
  Search this Thread
Old 06-11-2005, 09:59 AM   #16
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30

Sorry about the "copy" command,
Code:
bash: copy: command not found
That was my quicktyping, copy under linux is called "cp"
BTW: you should learn how to read error messages.
The code above showed the following:
BASH: ( = "heelo I'm bash, your linux command shell " )
COPY: ( = "about this copy command you gave me" )
COMMAND NOT FOUND ( = " I cannot do this COPY thing, I don't know what it is, maybe you mistyped it ,or something else is wrong. trying to issue COPY again willnot help, because I don't know what COPY is " )

Anyway, the situation is very funny, you have the wrong file permissions on the /home/myname directory.

as root do
Code:
cd /home
chmod -R u+rw myname

cd myname
find -type d | while read DIR  ; do 
chmod u+x "$DIR"
done
the "find -type d | while read DIR ; do " command is a loop,
it finds all "files" of the type DIRECTORY ( so it finds all directories, but in UNIXes everything is a file, it is a philosophy thing, just like in WIN32 : "everything is an OBJECT" ), then for each found FILE (which is stored in the variable DIR, we change the permissions to allow searching (executing) the directory.
This should put some correct permisssions on all files , and directories in your home dir.

Big question is:
How did things get screwed up like this?

Did you copy you home directory to cd and back, or from to FAT32, or any thing like it?

Permissions like:
Code:
d--------T 51 myname guest 8.0K Jun 8 14:35 myname/
are not set easily :-)

I hope htis gets you going.
 
Old 06-12-2005, 04:15 AM   #17
linubex
Member
 
Registered: Mar 2005
Location: California
Distribution: mandrake 2008
Posts: 64

Original Poster
Rep: Reputation: 16
as root do
Code:
cd /home
chmod -R u+rw myname

cd myname
find -type d | while read DIR  ; do 
chmod u+x "$DIR"
done
the "find -type d | while read DIR ; do " command is a loop,
it finds all "files" of the type DIRECTORY ( so it finds all directories, but in UNIXes everything is a file, it is a philosophy thing, just like in WIN32 : "everything is an OBJECT" ), then for each found FILE (which is stored in the variable DIR, we change the permissions to allow searching (executing) the directory.
This should put some correct permisssions on all files , and directories in your home dir.

Big question is:
How did things get screwed up like this?

Did you copy you home directory to cd and back, or from to FAT32, or any thing like it?

Nope, I didn't do anything along these lines.
Ok, so I now have my guest account back - I'm not sure why, but I'm that closer to happy. As for my account, well, that is a different story, I still cannot get access to it. I went back to the cp command from an earlier post, and this is what happened:

[root@localhost root]# cd /home
[root@localhost home]# mkdir myname
mkdir: cannot create directory `myname': File exists
[root@localhost home]# cd etc/skell
bash: cd: etc/skell: No such file or directory
[root@localhost home]# cp -R * .* /home/myname
cp: cannot copy a directory, `myname', into itself, `/home/myname/myname'
cp: cannot copy a directory, `myname', into itself, `/home/myname/myname'
cp: cannot copy a directory, `myname', into itself, `/home/myname/myname'

That didn't seem to go very well, so then I checked the file permissions again:

[root@localhost root]# ls -lah /home
total 32K
drwxr-xr-x 7 root root 4.0K Jun 6 23:52 ./
drwxr-xr-x 19 root adm 4.0K Jun 8 19:19 ../
drwx--x--x 23 guest guest 4.0K Jun 6 11:09 guest/
drwx--x--x 2 root root 4.0K Mar 18 13:38 lost+found/
d--------T 54 guest guest 8.0K Jun 12 01:38 myname/
drwx--x--x 30 mary mary 4.0K Jun 11 09:15 mary/
drwx------ 2 root root 4.0K Jun 9 03:02 .Trash-root/
[root@localhost root]#

These are all the same as my last post. Then I did what you told me to above:

[root@localhost root]# cd /home
[root@localhost home]# chmod -R u+rw myname
[root@localhost home]# cd myname
[root@localhost myname]# find -type d | while read DIR ; do
> chmod u+x "$DIR"
> done
[root@localhost myname]#

Then I checked the file permissions again:

[root@localhost myname]# ls -lah /home
total 32K
drwxr-xr-x 7 root root 4.0K Jun 6 23:52 ./
drwxr-xr-x 19 root adm 4.0K Jun 8 19:19 ../
drwx--x--x 23 guest guest 4.0K Jun 12 01:54 guest/
drwx--x--x 2 root root 4.0K Mar 18 13:38 lost+found/
drwx-----T 54 guest guest 8.0K Jun 12 01:38 myname/
drwx--x--x 30 mary mary 4.0K Jun 11 09:15 mary/
drwx------ 2 root root 4.0K Jun 9 03:02 .Trash-root/
[root@localhost myname]#

I see that some permissions have changed: drwx-----T 54 guest guest 8.0K Jun 12 01:38 myname/

However, I am still unable to access my account without resorting to root. I greatly appreciate that you have explained most of what you have asked me to do, and now I have another question for you. I don't understand why two of these are the same, but the third is not:

drwx--x--x 23 guest guest 4.0K Jun 12 01:54 guest/
drwx--x--x 30 mary mary 4.0K Jun 11 09:15 mary/
drwx-----T 54 guest guest 8.0K Jun 12 01:38 myname/

Shouldn't it be myname myname 8.0K Jun 12 01:38 myname - the same format as the "working" accounts? And what is that "T" mean?! On a related note, what is lost+found and its relation to root?

Finally, I just want to say that I bought an introductory book to linux tonight - hopefully I won't be a newbie to linux forever. I'm sure I'm asking you some very basic questions.


 
Old 06-13-2005, 02:45 PM   #18
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30
You are right, myname, should be owned by myname.
The directory "myname" is (somehow again) owned by "guest", do (as root):


Code:
cd /home
chown -R myname.myname myname
chmod -R -t myname
The last chmod command removes the T permission (the sticky bit :-) really, it is called that way, if you want to know more, google for it, but it should not bother you yet)

This should do the trick

Don't bother to copy /etc/skell, this is only needed when you have no HomeDirectory for the user yet.

The "lost+found" directory is located on the root directory of every mounted partition.
If you screw up the filesystem, and do a filsystem check, all files that cannot be properly restored land here.
Because the system does not know whose files they were, these are all owned by root now. This is a security thing. The directory should be empty anyway, unless you are in dire straits allready.

Buying a lnux book is "a very good thing to do" (tm)
I allways advice anybody who is new to linux to _buy_ Suse or mandrake, because of the crapload of documentation you get with them, very important and very basic stuff.
(Well, they used to be good, but I have last seen a SUSE box, about Suse 5 and Redhat 6 times, that's a few years ago.)

If you know your way around after reading the book, you can get your hands dirty and install Debian (plain sarge, not ubuntu or something like it) or gentoo.
That's were the real fun starts.

But as allways in live: big things always start out as simple litle things, givven enough time to grow.

Happy Hacking!

Last edited by huibert.alblas; 06-13-2005 at 02:48 PM.
 
Old 06-14-2005, 01:31 AM   #19
linubex
Member
 
Registered: Mar 2005
Location: California
Distribution: mandrake 2008
Posts: 64

Original Poster
Rep: Reputation: 16
[QUOTE]Originally posted by huibert.alblas
[B]You are right, myname, should be owned by myname.
The directory "myname" is (somehow again) owned by "guest", do (as root):


Code:
cd /home
chown -R myname.myname myname
chmod -R -t myname
The last chmod command removes the T permission (the sticky bit :-) really, it is called that way, if you want to know more, google for it, but it should not bother you yet)

This should do the trick

Ugh. I feel as if we are getting closer - but not there yet. I did as you said above, but I still cannot gain a successful login. Here are the latest permissions, and I seem to be missing some from the other accounts:

[root@localhost root]# ls -lah /home
total 32K
drwxr-xr-x 7 root root 4.0K Jun 6 23:52 ./
drwxr-xr-x 19 root adm 4.0K Jun 12 18:25 ../
drwx--x--x 23 guest guest 4.0K Jun 12 01:54 guest/
drwx--x--x 2 root root 4.0K Mar 18 13:38 lost+found/
d--------T 56 guest guest 8.0K Jun 13 11:50 myname/
drwx--x--x 30 mary mary 4.0K Jun 11 09:15 mary/
drwx------ 2 root root 4.0K Jun 9 03:02 .Trash-root/
[root@localhost root]#

Now that's funny. When last I checked, the permissions were different, showing myname myname where it should, but now it says guest guest. I'm going to run through you instructions above, again:

[root@localhost root]# cd /home
[root@localhost home]# chown -R myname.myname myname
[root@localhost home]# chmod -R -t myname
[root@localhost home]# ls -lah /home
total 32K
drwxr-xr-x 7 root root 4.0K Jun 6 23:52 ./
drwxr-xr-x 19 root adm 4.0K Jun 12 18:25 ../
drwx--x--x 23 guest guest 4.0K Jun 12 01:54 guest/
drwx--x--x 2 root root 4.0K Mar 18 13:38 lost+found/
d--------- 56 myname myname 8.0K Jun 13 11:50 myname/
drwx--x--x 30 mary mary 4.0K Jun 11 09:15 mary/
drwx------ 2 root root 4.0K Jun 9 03:02 .Trash-root/
[root@localhost home]#

Ok, so now I'm going to logout of root, go back to the gui login and try to login as myname. I'll edit this post in a few minutes. I do believe I'm correct in assuming that when I come back to ls -lah/home in a few minutes, nothing should have changed.

I'm back (having logged out and shutdown). I checked the permissions and all is as it should be. However, I still cannot login as myname. I use Gnome as my desktop, so I've been trying to login as Gnome each time - without success. This last time I tried KDE under myname and here are the error messages I received:

Error message 1:

No write access to $Home directory (1)
KDE is unable to start

Error message 2:

There was a system error setting up inter-process communications for KDE. The message returned by the system was:
could not rerad network connection list.
//. DCOPserver_localhost_0
Please check that the "dcopserver" program is running.

Error message 3:

will not save configuration
configuration file "//.kde/share/config/Ksplashrc not writeable
configuration file "//.kde/share/config/Kdeglobal not writeable

Error message 4:

No write access to $Home directory (1)
KDE is unable to start


I hope these are clues that help.

(close but not yet)

Last edited by linubex; 06-14-2005 at 01:50 AM.
 
Old 06-14-2005, 04:47 AM   #20
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30
EDIT (shortly after my post, I saw my errors!!) :
Damn!!!

I gave you the wrong script.
Tis would should set the xorrect permissions:
Code:
cd /home
chmod -R u+rw myname

cd myname
find -type d | while read DIR  ; do chmod u+rwx "$DIR" ; done
You can read on for the old message, just ignore the ranting, please.

The old messege:


Quote:
d--------- 56 myname myname 8.0K Jun 13 11:50 myname/
I don't know what keeps resetting the filepermissions on your system, because the permissions were correct at sometime in the past (I could see from your posts) and now they are borked again.

To setup propper permissiosn on your home dir repeat these steps (as root):

Code:
cd /home
chmod -R u+rw myname

cd myname
find -type d | while read DIR  ; do chmod u+rwx "$DIR" ; done
Unless you are constantly fiddling around whithout really knowing what you are doing (which would be perfectly normal in your situation) there must be some programm/background task setting directories to the wrong permissions.

You need to look closer to the infromation givven to you by me, and the system.

As you have listed you /home/ dir

this:
Code:
d--------- 56 myname myname 8.0K Jun 13 11:50 myname/
shows, that you will not be able to login to the gui, because you cannot write to you own home directory.
Until this is not solved, trying to use X is futile.

This whole discussion ran around 2 things:
- /home/myname was not owned by myname
- /home/myname had totaly wrong file permissions

This should have been easy to fix, had you just done what I told you.
By "just done" I mean, reading, executing and than reading again, and trying to understand waht happened and why....

I know I'm ranting a bit, but this could have been solved in 2 posts,
And i just hate it when stuff doesn't work the way it is supposed to be :-), so I will keep on posting here, until you can login into your computer...
I need some smileys here, but I don't know how to insert them,
could you explain where you get the blinking smileys?

To make a long story short.
"Set the right permissions, and your ready to go."

Happy Hacking!

Last edited by huibert.alblas; 06-14-2005 at 04:58 AM.
 
Old 06-21-2005, 12:36 PM   #21
linubex
Member
 
Registered: Mar 2005
Location: California
Distribution: mandrake 2008
Posts: 64

Original Poster
Rep: Reputation: 16
FINALLY!!!


[NOTICE: message below this one]


Hey Huibert!
All seems to be working well now! I've posted my final commands below, mostly so that others may be able to see the final solution of all this trouble. I'm not convinced that there is something somewhere resetting my permissions, but I have just finished a series of logins logouts and shutdowns and all seems to be holding.
Oh, and for whatever reason, I am now able to boot Mozilla. The other users were always able to boot it up, but I wasn't able to do so.

Thank-YOU!



[root@localhost root]# ls -lah /home
total 32K
drwxr-xr-x 7 root root 4.0K Jun 6 23:52 ./
drwxr-xr-x 19 root adm 4.0K Jun 21 09:16 ../
drwx--x--x 23 guest guest 4.0K Jun 14 19:53 guest/
drwx--x--x 2 root root 4.0K Mar 18 13:38 lost+found/
d--------T 56 guest guest 8.0K Jun 14 20:08 myname/
drwx--x--x 30 mary mary 4.0K Jun 20 19:37 mary/
drwx------ 2 root root 4.0K Jun 15 18:50 .Trash-root/

[root@localhost root]# cd /home
[root@localhost home]# chmod -R u+rw myname
[root@localhost home]# cd myname
[root@localhost myname]# find -type d | while read DIR ; do chmod u+rwx "$DIR" ; done
[root@localhost myname]# ls -lah /home total 32K
drwxr-xr-x 7 root root 4.0K Jun 6 23:52 ./
drwxr-xr-x 19 root adm 4.0K Jun 21 09:16 ../
drwx--x--x 23 guest guest 4.0K Jun 14 19:53 guest/
drwx--x--x 2 root root 4.0K Mar 18 13:38 lost+found/
drwx-----T 56 guest guest 8.0K Jun 14 20:08 myname/
drwx--x--x 30 mary mary 4.0K Jun 20 19:37 mary/
drwx------ 2 root root 4.0K Jun 15 18:50 .Trash-root/

[root@localhost myname]# cd /home
[root@localhost home]# chown -R myname.myname myname
[root@localhost home]# chmod -R -t myname
[root@localhost home]# ls -lah /home
total 32K
drwxr-xr-x 7 root root 4.0K Jun 6 23:52 ./
drwxr-xr-x 19 root adm 4.0K Jun 21 09:16 ../
drwx--x--x 23 guest guest 4.0K Jun 14 19:53 guest/
drwx--x--x 2 root root 4.0K Mar 18 13:38 lost+found/
drwx------ 56 myname myname 8.0K Jun 14 20:08 myname/
drwx--x--x 30 mary mary 4.0K Jun 20 19:37 mary/
drwx------ 2 root root 4.0K Jun 15 18:50 .Trash-root/
[root@localhost home]#

Last edited by linubex; 06-21-2005 at 01:15 PM.
 
Old 06-21-2005, 01:14 PM   #22
linubex
Member
 
Registered: Mar 2005
Location: California
Distribution: mandrake 2008
Posts: 64

Original Poster
Rep: Reputation: 16
Angry Damn IT

Hello Huibert,
Apparently I did speak to soon. I went t o login and I couldn't. Permissions are back to what they were...

d--------T 56 guest guest 8.0K Jun 21 10:18 myname/

What could be resetting them? My computer has been on since I posted the message above and I haven't done anything unusual (I haven't tried to modify anything). The only thing that has happened is that I logged out of root to gui login and then the screen eventually went black - the screensaver I guess. Ideas!?


 
Old 06-24-2005, 06:44 AM   #23
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30
Uhoh,

that's a nasty problem you got there.
What bothers me the most is that not only are your permissions reset to bogus entries, but is also re-chowned to guest.guest.

This forebodes nothing good.

Could you please check /etc/passwd for any anomalies?
Every "real" user should have a "correct" homedirectory.

BTW: the user "myname" is not particulary well thought out :-)
It always reminds me of Steve-O- with his "your name" tattoo on his butt. (Because the shop advertisement said: "we tattoo your name where ever you want it")
But I'm getting OT.

Take a good look at the results of "ps ax" and look for "funny" looking procceses.
I know this is not easy for you, being a Linux newbie.

You could ofcource post the results from /etc/passwd and "ps ax" here, but only if you are _really_ sure that you have shadow passwords enabled.
Otherwise everybody and his granddad could start decrypting your passwords.


The funny thing is, that only the "myname" user permissions are reset. Could you take a look (as root) inside /home/myname and so a "ls -lah" here?
I would like to know if only the directory entry /home/myname is affected up, or if your whole home directory (recursivly).

The next thing then is reset your permissions (you know how to do it now :-) ) and periodicly check if they are still ok.
If they are screwed up, try to remeber what you have done between them being OK and broken. (what programms have been running, deamons started/stoppped, whatever)

"viel Erfolg" as we say in Germany.

Happy Hacking
 
  


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
reset root password kapslock Debian 14 07-27-2006 07:08 AM
Password reset hongman Linux - Newbie 2 07-11-2005 05:46 AM
MDK 9.2 sysctl.conf being reset by shorewall? JohnLocke Linux - Security 3 07-24-2004 09:02 PM
reset the password ust Linux - General 1 02-11-2004 06:35 AM
Reset Root password sdsouza Linux - Software 5 11-12-2003 04:50 PM

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

All times are GMT -5. The time now is 09:15 AM.

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