LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-20-2010, 05:54 PM   #1
fcintron
Member
 
Registered: Oct 2010
Location: México
Distribution: Centos
Posts: 72

Rep: Reputation: 4
cannot login as root in console(tty1-tty6)...


I has Centos 5.5 with kernel 2.6.18-194.17.1.el5.

centos-release-5-5.el5.centos
Linux centos 2.6.18-194.17.1.el5 #1 SMP Wed Sep 29 12:50:31 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

My problem is this:

I can login as root in to Gnome and ssh but not in console
In fact I can login with anyuser in to Gnome and ssh but not in console.

By the console I'm referring to tty1-tty6.

When the login screen is showed I write the user and password but then a message is quickly(I can´t see it) showed and erased and the login screen is showed again

I looked the file /etc/security/access.conf but all the entries are marked as comments.

I also looked the file /etc/securetty and this is the content:

console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11


I even can use "su" with anyuser with no problem.

The next entries are written in the /var/log/audit/audit.log file everytime I has this error:


type=USER_AUTH msg=audit(1284441198.687:5305): user pid=21795 uid=0 auid=4294967295 msg='PAM: authentication acct="root" : exe="/bin/login" (hostname=?, addr=?, terminal=tty2 res=success)'
type=USER_ACCT msg=audit(1284441198.687:5306): user pid=21795 uid=0 auid=4294967295 msg='PAM: accounting acct="root" : exe="/bin/login" (hostname=?, addr=?, terminal=tty2 res=success)'
type=LOGIN msg=audit(1284441198.694:5307): login pid=21795 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=430
type=USER_START msg=audit(1284441198.694:530: user pid=21795 uid=0 auid=0 msg='PAM: session open acct="root" : exe="/bin/login" (hostname=?, addr=?, terminal=tty2 res=failed)


Selinux is turned off.

May you help me please to correct this error?
Thanks in advance for your help.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-20-2010, 09:21 PM   #2
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Have a look at /var/log/secure.
 
1 members found this post helpful.
Old 10-21-2010, 01:48 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Root logins should be restricted to the system console. This may be enforced in a file in /etc/security/. Pay attention to the PAM configurations and access.conf. What is wrong with logging in as a normal user and su'ing to root or using logged sudo commands?

Also, reconsider disabling selinux protection.
 
Old 10-21-2010, 09:56 AM   #4
fcintron
Member
 
Registered: Oct 2010
Location: México
Distribution: Centos
Posts: 72

Original Poster
Rep: Reputation: 4
Thank you man...

Quote:
Originally Posted by quanta View Post
Have a look at /var/log/secure.
thank you, I am going to read these files.
 
Old 10-21-2010, 10:16 AM   #5
fcintron
Member
 
Registered: Oct 2010
Location: México
Distribution: Centos
Posts: 72

Original Poster
Rep: Reputation: 4
Umm I thought it was a problem...

Quote:
Originally Posted by jschiwal View Post
Root logins should be restricted to the system console. This may be enforced in a file in /etc/security/. Pay attention to the PAM configurations and access.conf. What is wrong with logging in as a normal user and su'ing to root or using logged sudo commands?

Also, reconsider disabling selinux protection.
I have been a windows administrator for 15 years and this is the first linux server I have to install and administrate.

I chose centos because a friend of mine told me It was one of the best linux distros for servers.

The default configuration in centos let me login with root in to gnome, ssh and console(tty1-tty6) for this reason I thought it was a problem.

It seems that I wil have to harden the security of the server.

Thanh you for your help
 
Old 10-21-2010, 10:52 AM   #6
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
Originally Posted by fcintron View Post
I have been a windows administrator for 15 years and this is the first linux server I have to install and administrate.

I chose centos because a friend of mine told me It was one of the best linux distros for servers.

The default configuration in centos let me login with root in to gnome, ssh and console(tty1-tty6) for this reason I thought it was a problem.

It seems that I wil have to harden the security of the server.

Thanh you for your help
You may also wish to check out the LQ Wiki under networking since you're new to Linux serving. There's a lot of good information and while it does not pertain specifically to CentOS it is still useful to know. It can be applied to CentOS.

Run vimtutor in the terminal because knowing a terminal based text editor is essential. Run "man man" in the terminal to familiarize yourself with the man pages when you need to know the options of a command. Looking up a tutorial on the bash shell is also essential because piping commands and redirecting stout/sterr is a very powerful thing (my LQ Blog lists some examples). As always LQ will be around to fill in the blanks.

Last edited by sag47; 10-21-2010 at 10:59 AM.
 
1 members found this post helpful.
Old 10-24-2010, 08:14 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
Originally Posted by fcintron View Post
I have been a windows administrator for 15 years and this is the first linux server I have to install and administrate.

I chose centos because a friend of mine told me It was one of the best linux distros for servers.

The default configuration in centos let me login with root in to gnome, ssh and console(tty1-tty6) for this reason I thought it was a problem.

It seems that I wil have to harden the security of the server.

Thanh you for your help
Since you mentioned running sshd, I thought I would mention some things to consider to further secure it. Consider using pubkey authentication instead of Challenge Response authentication. The /etc/ssh/sshd_config file has instructions for setting this up in the comments:
Code:
# Set this to 'yes' to enable PAM authentication, account processing, 
# and session processing. If this is enabled, PAM authentication will 
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
Disabling root logins, and adding "AllowUsers username ..." will further secure the sshd service.

You can use:
eval $(ssh-agent)
ssh-add

at your remote client to hold your private key's passphrase. This allows seemingly logging in without a passphrase. You can even put a shortcut on your screen that starts a graphical program remotely via ssh. I added this to an icon's Command line: ssh -X elite 'inkscape %F'. Clicking on the inkscape icon starts the program on my desktop, displaying it on my laptop. You could do the same thing with one of the system-config-* programs or log viewer programs, when the server is running in run level 3. Just insert `gnomesu' after the opening quote to run one of the system configuration programs remotely.

Script kiddies attacking the server will be trying username/password brute force attacks. And the "root" user is their main target. Using "AllowUsers" will also disallow system users not listed. Which are also targets of script kiddies.

Last edited by jschiwal; 10-24-2010 at 08:20 PM.
 
3 members found this post helpful.
  


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
How can I start a program from tty1 console to be executed in tty2 console? jtag Linux - Software 6 09-10-2010 07:13 PM
graphics resolution in tty1->tty6 radiodee1 Debian 2 06-23-2010 08:19 AM
[SOLVED] Ubuntu 9.10: using screen in tty1-tty6 ESC201 Linux - Software 2 12-13-2009 03:33 PM
tty1-tty6 gone blind after compile kernel 2.6.19.2 shadowdancer Slackware 6 01-21-2007 02:51 AM
tty1-tty6 black screen with 2.6.6 agents Linux - Newbie 1 05-21-2004 11:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:20 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