MandrivaUsers.org : Strange su/login problem - MandrivaUsers.org

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Strange su/login problem

#1 User is offline   scoonma 

  • Awesome
  • Group: Members
  • Posts: 458
  • Joined: 30-June 06

Posted 10 August 2006 - 10:38 AM

Hi all,

I recently stumbled over a strange problem of similar type Urza reported of:

Unable to login as *any* user, I still can login to the system (Mandriva 2007 cooker) as root. Trying to login as normal user from console (i.e. "login: " prompt, the system kicks me out immediately. By lowering processor speed I was able to see the small error message: It says there is no home directory for that user, but it actually exists! There is no kernel message giving any hint on "F-12 console", no valuable information on /var/log/messages or /var/log/secure.

When trying to "su <user>" after root login, the only error is "could not open session". By googling I found out that this could be caused by file permissions wrongly set. So I've checked the following (which should be okay, AFAIK):

/etc drwxr-xr-x
/etc/pam.d drwxr-xr-x
/etc/passwd rw-r--r--
/etc/shadow rw-------

It does not matter wether trying to use an existing user in /home or after creating a new one with "useradd", so it's likely to be a system wide error. Last option that came to my mind is to use strace. I tried

"strace -oout.txt su <user>" and found the following:

[...]
open("/etc/pam.d/other", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=154, ...}) = 0
mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d01000
read(3, "#%PAM-1.0\nauth required "..., 131072) = 154
read(3, "", 131072) = 0
close(3) = 0
munmap(0xb7d01000, 131072) = 0
getuid32() = 0
getuid32() = 0
open("/etc/passwd", O_RDONLY) = 3
fcntl64(3, F_GETFD) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=1340, ...}) = 0
mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d01000
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 131072) = 1340
close(3) = 0
munmap(0xb7d01000, 131072) = 0
time(NULL) = 1155194279
getuid32() = 0
getuid32() = 0
open("/etc/passwd", O_RDONLY) = 3
fcntl64(3, F_GETFD) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=1340, ...}) = 0
mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d01000
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 131072) = 1340
close(3) = 0
munmap(0xb7d01000, 131072) = 0
open("/etc/shadow", O_RDONLY) = 3
fcntl64(3, F_GETFD) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
fstat64(3, {st_mode=S_IFREG|0600, st_size=831, ...}) = 0
mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d01000
read(3, "root:$1$pAlg6jqo$Q4EOt4pn2aApAsq"..., 131072) = 831
close(3) = 0
munmap(0xb7d01000, 131072) = 0
time(NULL) = 1155194279
setfsuid32(501) = 0
setfsgid32(501) = 0
access("/usr/bin/xauth", X_OK) = 0
open("/etc/passwd", O_RDONLY) = -1 EACCES (Permission denied)
open("/etc/ld.so.cache", O_RDONLY) = -1 EACCES (Permission denied)
open("/lib/tls/i686/libnss_compat.so.2", O_RDONLY) = -1 EACCES (Permission denied)
open("/lib/tls/libnss_compat.so.2", O_RDONLY) = -1 EACCES (Permission denied)
open("/lib/i686/libnss_compat.so.2", O_RDONLY) = -1 EACCES (Permission denied)
open("/lib/libnss_compat.so.2", O_RDONLY) = -1 EACCES (Permission denied)
open("/usr/lib/tls/i686/libnss_compat.so.2", O_RDONLY) = -1 EACCES (Permission denied)
open("/usr/lib/tls/libnss_compat.so.2", O_RDONLY) = -1 EACCES (Permission denied)
open("/usr/lib/i686/libnss_compat.so.2", O_RDONLY) = -1 EACCES (Permission denied)
open("/usr/lib/libnss_compat.so.2", O_RDONLY) = -1 EACCES (Permission denied)
getuid32() = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
readlink("/proc/self/fd/0", 0x8055f70, 4095) = -1 EACCES (Permission denied)
fstat64(0, {st_mode=S_IFCHR|0600, st_size=makedev(0, 0), ...}) = 0
stat64("/dev/pts", 0xbff16878) = -1 EACCES (Permission denied)
open("/dev", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 EACCES (Permission denied)
getuid32() = 0
time(NULL) = 1155194279
open("/etc/localtime", O_RDONLY) = -1 EACCES (Permission denied)
open("/etc/localtime", O_RDONLY) = -1 EACCES (Permission denied)
open("/etc/localtime", O_RDONLY) = -1 EACCES (Permission denied)
open("/etc/localtime", O_RDONLY) = -1 EACCES (Permission denied)
socket(PF_FILE, SOCK_DGRAM, 0) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
connect(3, {sa_family=AF_FILE, path="/dev/log"}, 110) = -1 EACCES (Permission denied)
close(3) = 0
write(2, "could not open session\n", 23) = 23
exit_group(1) = ?


Any ideas please?

Greetings,

scoonma


[moved from Software by spinynorman]
"The rich man considers everything as buyable, since he knows himself as the power from the specialty of his self-awareness. Thus wealth can lead to the same mockery and gracelessness to which indigent ragtag goes." "Poverty itself does not make anyone raffish."

G.W.F. Hegel
0

#2 User is offline   ianw1974 

  • Platinum
  • Group: Admin
  • Posts: 14,092
  • Joined: 09-March 05

Posted 10 August 2006 - 11:08 AM

Check the permissions on the home directory. Does it exist? Also, check /etc/passwd by doing this:

[ian@europa ~]$ cat /etc/passwd | grep ian
ian:x:500:500:Ian Walker:/home/ian:/bin/bash


as I have here filtering by my user. You can see my home directory is /home/ian. So if this isn't pointing to where it should be, do this:

usermod -d /home/ian ian


if that doesn't work, we need to see if the permissions are screwed:

[ian@europa home]$ ls -l | grep ian
drwxr-xr-x  56 ian ian 2544 Aug 10 13:06 ian/


so, as you can see, mine is set correct, but maybe your home has other details. Reset it with:

chown -R ian:ian /home/ian


and that should reset all the files in /home/ian and make sure you're back up and running.
Ian Walker

Light travels faster than sound. This is why some people appear bright until you hear them speak.........

My Linux Solutions | Linux Systems Limited
0

#3 User is offline   scoonma 

  • Awesome
  • Group: Members
  • Posts: 458
  • Joined: 30-June 06

Posted 10 August 2006 - 11:42 AM

Hi Ian,

thx for your fast response! I've done/re-checked what you suggested (/home dir exists, has correct permissions, ...), but unfortunately it does not help.

The clue must be located elsewhere. When being root, "su clamav" or "su adm" (or any other user) do result in the very same error: "could not open session". This is why I'm so puzzled.

Regards,

scoonma
"The rich man considers everything as buyable, since he knows himself as the power from the specialty of his self-awareness. Thus wealth can lead to the same mockery and gracelessness to which indigent ragtag goes." "Poverty itself does not make anyone raffish."

G.W.F. Hegel
0

#4 User is offline   ianw1974 

  • Platinum
  • Group: Admin
  • Posts: 14,092
  • Joined: 09-March 05

Posted 10 August 2006 - 11:52 AM

What shell has been assigned to each user? This is at the end of each line in /etc/passwd.

For normal users to login, it would be /bin/bash.
Ian Walker

Light travels faster than sound. This is why some people appear bright until you hear them speak.........

My Linux Solutions | Linux Systems Limited
0

#5 User is offline   ffi 

  • Mandriva Guru
  • Group: Members
  • Posts: 1,544
  • Joined: 05-February 06

Posted 10 August 2006 - 11:56 AM

I have seen similar error messages after I got a bit too thorough deleting files from my home dir ( I wanted to go back to the default setting, so had deleted most .dirs)

did you try creating a fresh user?

This post has been edited by ffi: 10 August 2006 - 11:56 AM

"Of liberty I would say that, in the whole plenitude of its extent, it is unobstructed action according to our will. But rightful liberty is unobstructed action according to our will within limits drawn around us by the equal rights of others. I do not add 'within the limits of the law,' because law is often but the tyrant's will, and always so when it violates the right of an individual."
Thomas Jefferson
0

#6 User is offline   ianw1974 

  • Platinum
  • Group: Admin
  • Posts: 14,092
  • Joined: 09-March 05

Posted 10 August 2006 - 12:27 PM

Ah, ffi made me think of something. You might need to look to see if your .bash files exist in your /home/username directory. If not, you can always copy them over again from /etc/skel directory.
Ian Walker

Light travels faster than sound. This is why some people appear bright until you hear them speak.........

My Linux Solutions | Linux Systems Limited
0

#7 User is offline   scoonma 

  • Awesome
  • Group: Members
  • Posts: 458
  • Joined: 30-June 06

Posted 11 August 2006 - 12:53 AM

Thx for your hints!

However, the error resists. Shell is /bin/bash, (as normal). The .bash* files within /home/user dir are all intact (and are rarely touched).

When creating new users, their accounts suffer from the same problem (i.e. su/login not possible). The corresponding directories are created though, also the defaults from /etc/skel are copied.

I did some further googling and found this page: http://www.wlug.org.nz/EACCES. It states that the EACCES error mentioned above is likely being caused by file permission conflicts, but I don't know which places I still haven't checked. Last "candidate" was /bin/bash; I changed permissions from rwx------ to rwxr-xr-x, but this didn't help either.

The offending place must be rather central, but not influencing the root acount in this regard. Hm.

This post has been edited by scoonma: 11 August 2006 - 12:54 AM

"The rich man considers everything as buyable, since he knows himself as the power from the specialty of his self-awareness. Thus wealth can lead to the same mockery and gracelessness to which indigent ragtag goes." "Poverty itself does not make anyone raffish."

G.W.F. Hegel
0

#8 User is offline   aioshin 

  • MUB Addict
  • Group: Members
  • Posts: 816
  • Joined: 23-August 04

Posted 11 August 2006 - 01:11 AM

try to chmod 755 the /home dir

chmod 755 /home

then try to chown your $HOME dir

chown user.user -R /home/user

user is your normal username


and see if that helps..

This post has been edited by aioshin: 11 August 2006 - 01:14 AM

Mandriva 2008.1 @wORk
Mandriva 2008.1 @ hOMe
0

#9 User is offline   scoonma 

  • Awesome
  • Group: Members
  • Posts: 458
  • Joined: 30-June 06

Posted 11 August 2006 - 10:23 AM

Hi aioshin,

you wrote:

Quote

try to chmod 755 the /home dir

then try to chown your $HOME dir


Tried, but it didn't help. I'm suspecting an issue with pam now. But re-installing passwd and pam didn't help either. Too bad!

scoonma
"The rich man considers everything as buyable, since he knows himself as the power from the specialty of his self-awareness. Thus wealth can lead to the same mockery and gracelessness to which indigent ragtag goes." "Poverty itself does not make anyone raffish."

G.W.F. Hegel
0

#10 User is offline   ffi 

  • Mandriva Guru
  • Group: Members
  • Posts: 1,544
  • Joined: 05-February 06

Posted 11 August 2006 - 11:01 AM

Did you update all files in /etc to their new versions?

I use etc-update available through either main or contrib....
"Of liberty I would say that, in the whole plenitude of its extent, it is unobstructed action according to our will. But rightful liberty is unobstructed action according to our will within limits drawn around us by the equal rights of others. I do not add 'within the limits of the law,' because law is often but the tyrant's will, and always so when it violates the right of an individual."
Thomas Jefferson
0

#11 User is offline   ianw1974 

  • Platinum
  • Group: Admin
  • Posts: 14,092
  • Joined: 09-March 05

Posted 11 August 2006 - 11:10 AM

I use that tool in gentoo, really cool way of doing it. My method I learnt in Mandrake/Mandriva:

updatedb && slocate rpmnew


and you'll get a load of .conf.rpmnew files listed, and you can then replace them where necessary.
Ian Walker

Light travels faster than sound. This is why some people appear bright until you hear them speak.........

My Linux Solutions | Linux Systems Limited
0

#12 User is offline   aioshin 

  • MUB Addict
  • Group: Members
  • Posts: 816
  • Joined: 23-August 04

Posted 11 August 2006 - 12:44 PM

if its ok, can you post the result of

ls -l /

and ls -l /home

just rename your users dir
Mandriva 2008.1 @wORk
Mandriva 2008.1 @ hOMe
0

#13 User is offline   scoonma 

  • Awesome
  • Group: Members
  • Posts: 458
  • Joined: 30-June 06

Posted 11 August 2006 - 03:17 PM

I've used etc-update but this was doing no good. After rebooting, the whole filesystem was crashed beyond repair. There must have gone something deeply wrong. Now I've reinstalled from scratch (everything except /home) and the system runs fine again. But I hate this sort-of windumb method for fixing...

Thx nonetheless!

scoonma
"The rich man considers everything as buyable, since he knows himself as the power from the specialty of his self-awareness. Thus wealth can lead to the same mockery and gracelessness to which indigent ragtag goes." "Poverty itself does not make anyone raffish."

G.W.F. Hegel
0

#14 User is offline   Gowator 

  • always learning
  • Group: Platinum
  • Posts: 5,674
  • Joined: 09-May 03

Posted 11 August 2006 - 03:33 PM

Probably a file ownership prob in the .kde or tmp dir. You could su to a user...
what aioshin said should have fixed it but it might have given an error message you missed?

Also a full /home will do this as will a corrupt file in the .kde

The best thing as someone already said is create a new user.
Apart from anything else having a spare test user is not a bad idea for playing with themes and such anyway.
Fere libenter homines id quod volunt credunt. (J.C. de Bello Gallico III/XVIII)

Visit my visitor site for coelaics, find out what a coelaic is even.
http://linuxmigratio....fr/glutenfree/
0

#15 User is offline   ffi 

  • Mandriva Guru
  • Group: Members
  • Posts: 1,544
  • Joined: 05-February 06

Posted 11 August 2006 - 03:48 PM

View Postscoonma, on Aug 11 2006, 05:17 PM, said:

I've used etc-update but this was doing no good. After rebooting, the whole filesystem was crashed beyond repair. There must have gone something deeply wrong. Now I've reinstalled from scratch (everything except /home) and the system runs fine again. But I hate this sort-of windumb method for fixing...

Thx nonetheless!

scoonma

Sorry :sad:/>
"Of liberty I would say that, in the whole plenitude of its extent, it is unobstructed action according to our will. But rightful liberty is unobstructed action according to our will within limits drawn around us by the equal rights of others. I do not add 'within the limits of the law,' because law is often but the tyrant's will, and always so when it violates the right of an individual."
Thomas Jefferson
0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users