Click to See Complete Forum and Search --> : Strange login problem


asarch
03-04-2007, 12:58 AM
Hi guys:

I was making some backups with tar and gzip when I get this error from a directory:



tar: permission denied.

so I interrupted the process with CTRL+C and then I change the permission of that directory with:



# First, the directories
[$] find . -type d -exec chmod -v 700 {} \;

# And then the rest of files
[$] find . -not -type d -exec chmod -v 600 {} \;

At this point my session hangs up so I press CTRL+ALT+BACKSPACE to restart the X server.

When the graphical login screen appears I try to login but the only thing that happends was the screen flashes just like when you make a mistake with your password.

So I went to a terminal screen with CTRL+ALT+F1 and only this happends:



Login: asarch
Password:

Login failed!

At this point I was to start to scary because I thought somebody had cracked into my system. :eek:

So I login as root and check if my files was there and, not even as root could get into my home directory, I checked and it appears that the executable permission was removing so I change the permissions, check the content of my home directory and after see that the files were ok I try to login as asarch and this time this is what I get:



Login: asarch
Password:

No directory '/home/asarch'

in spite of that the directory actually exists and the permissions and the owners are ok.

So, I try to bypass the login process with:



[#] su asarch
su: permission denied

but it didn't work. :mad:

So I unmount the partition and try to do a reiserfsck but because I don't know its parameters I try to check the man page:


[#] man reiserfsck
execve: permission denied

Holy...! :eek:

I rebooted the system and used a LiveCD in the rescue mode and checked both partitions and both of them are ok.

This is how they are:



+---+ - +
|XXX| | / (/dev/sda1)
+---+ - +
|XXX| | Swap (/dev/sda2)
+---+ - +
|XXX| | /home (/dev/sda3)
+---+ - +


Question:
What is happenning with my system? :(

teeitup
03-04-2007, 03:01 AM
What user were you when you ran the find commands? (self or root)
What directory were you in when you ran the find commands?

Using the live CD mount the partition and check the permissions in the /usr and /etc directories. If they look like that of the find command then that might be your problem.

bwkaz
03-04-2007, 03:37 PM
FYI: I'd have used "-type f" instead of "-not -type d" in your find. Yes, this will skip symlinks (but then, when you give a symlink to chmod, it changes the permission on the target, not the link, so you want to skip links), FIFOs, sockets, device files, etc., but that shouldn't be too big of a problem.

I don't know whether this would have helped you or not, though. It may help now to (as root, from a separate livecd), run the first command again -- resetting execute permission on all the directories may help. If you had a symlink that pointed at a directory before, you may have broken the directory's permissions.

asarch
03-04-2007, 09:47 PM
Ok, let's go by parts:

First of all I was the normal user asarch when I ran those commands.

Second, I was in the directory /home/asarch/data.

Third, what if all the files in the directories /usr and /etc are changed, how can restore them as they used to be?

Fourht, actually making a better checking in the dir I found some sockets (?) in there. What are the sockets and what are they for?

Fith, in the case that the permissions of the directories /usr and /etc are changed, how can a normal user could do that?