Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-13-2010, 06:55 PM   #1
Senior Member
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
A question about the login command in CentOS...

For some reason every time I enter the 'login' command as root, my putty shell craps out. It's as if the kernel is not prepared or does not know how to handle the 'login' command. Where can I set it up? Maybe it's not configured to use PAM?

I want to use this command to switch users. Sure I can use 'su username' but I noticed there are some issues when using 'mail' command right after I change users. It gives me a permissions error as if the environment variable for mail is set for roots mailbox instead of the new users mailbox.

Anyhow, how can I configure 'login' to work properly in CentOS?
Old 08-14-2010, 04:22 AM   #2
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
I get the feeling this is intentional, even if it isn't... this is not the recommended way to use SSH anyway. It's recommended to have a normal user that can su to root or sudo rather then spending lots of time as root and generally speaking, root should not be an account that can be directly signed into over the Internet (after all most brute force attacks often target root). Doing this on a VM on my PC causes the shell to be logged out of, this makes my suspicious what is happening is that root is designed to be auto-logged out if you are going to do tasks as other uses. For putty where for SSH you are essentially suppose to be logged in as 'x' user, this function causes a log out what putty detects as an end of session... this is my guess anyway.

Last edited by r3sistance; 08-14-2010 at 04:23 AM.
Old 08-14-2010, 08:42 AM   #3
Senior Member
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,125
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
try using

su - user

instead of just
su user

it'll switch to the environment of the user rather than keeping the old environment


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
CentOS 5 with LDAP to Active Directory Login Question AtomicDon Linux - Newbie 4 05-28-2009 08:19 AM
automatic login Centos 4.4 ihopeto Red Hat 1 11-16-2008 03:58 PM
CentOS 5 (none)login : prompt athreyavc Linux - Software 2 04-17-2008 07:07 AM
CentOS wont login? SBN Linux - Software 1 10-11-2006 12:37 PM
Changin Graphical Login to command line login 3DLirio Linux - Newbie 2 10-16-2003 09:43 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:14 AM.

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