You are not logged in.

#1 2008-04-12 07:21:04

phabulosa
Member
From: Mountain View, CA
Registered: 2007-10-17
Posts: 182
Website

Unable to login within a shell already logged in

I am trying to run
login (to login as a different user) within a shell already logged in.

However,
I got the following error message.

No utmp entry. You must exec "login" from the lowest level "sh"

How to fix this , or any work around?

Offline

#2 2008-04-12 07:26:00

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: Unable to login within a shell already logged in

This may help: http://linux.about.com/library/cmd/blcmdl1_login.htm

"If the user is not root, and if /etc/nologin exists, the contents of this file are printed to the screen, and the login is terminated. This is typically used to prevent logins when the system is being taken down. "


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#3 2008-04-12 07:29:33

phabulosa
Member
From: Mountain View, CA
Registered: 2007-10-17
Posts: 182
Website

Re: Unable to login within a shell already logged in

dyscoria wrote:

This may help: http://linux.about.com/library/cmd/blcmdl1_login.htm

"If the user is not root, and if /etc/nologin exists, the contents of this file are printed to the screen, and the login is terminated. This is typically used to prevent logins when the system is being taken down. "

I am trying to login as a different user (not root, su works), and I don't have /etc/nologin

Offline

#4 2008-04-12 08:25:36

Jansson
Member
From: Sweden
Registered: 2006-09-10
Posts: 106

Re: Unable to login within a shell already logged in

If I understand you correctly, '#su' IS your friend. Try out '#su <username>'

Offline

#5 2008-04-12 08:41:10

phabulosa
Member
From: Mountain View, CA
Registered: 2007-10-17
Posts: 182
Website

Re: Unable to login within a shell already logged in

Jansson wrote:

If I understand you correctly, '#su' IS your friend. Try out '#su <username>'

You saved my day. I have been using linux for a couple of years and I never read 'su' manpage.

I always thought 'su' stands for SuperUser, instead of 'SubstituteUser'. smile

Just ask out of my curiosity, why does 'su' work but 'login' doesn't?

Is this related settings in /etc/pam.d ?

Offline

#6 2008-04-13 09:50:54

Jansson
Member
From: Sweden
Registered: 2006-09-10
Posts: 106

Re: Unable to login within a shell already logged in

Glad I could help:)  Login wont work because a session within the session isn't allowed. Check out man login wink

Offline

Board footer

Powered by FluxBB