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 08-12-2010, 08:10 AM   #1
cbowman@fnba.com
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Rep: Reputation: 0
Only root can log in


I'm a newbie and trying to harden a RHEL5 box which I think is up to date. I am able to ssh as root but when I try to ssh as another user (nloring) I get a 'permission denied' error. On the console, if I su to a non-root user then try to su to nloring I get an 'incorrect password' error. I've usermod -p the account and have unlocked the account but I still get the same error. There are a few posts in this forum that are similar, but none have helped me so far. Any suggestions?

Thanks
 
Old 08-12-2010, 08:22 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
What does /var/log/secure say??
 
1 members found this post helpful.
Old 08-12-2010, 08:37 AM   #3
cbowman@fnba.com
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Here is the whole session starting with the 'date' cmd.

[root@localhost log]# date
Thu Aug 12 01:31:54 EDT 2010
[root@localhost log]# su cbowman
[cbowman@localhost log]$ su nloring
Password:
su: incorrect password
[cbowman@localhost log]$ exit
exit
[root@localhost log]# tail secure
Aug 12 00:24:39 localhost su: pam_unix(su:auth): authentication failure; logname
=root uid=501 euid=0 tty=pts/0 ruser=cbowman rhost= user=nloring
Aug 12 00:24:42 localhost su: pam_unix(su:session): session closed for user cbow
man
Aug 12 00:24:46 localhost su: pam_unix(su:session): session opened for user nlor
ing by root(uid=0)
Aug 12 00:24:53 localhost su: pam_unix(su:session): session closed for user nlor
ing
Aug 12 01:30:46 localhost su: pam_unix(su:session): session opened for user cbow
man by root(uid=0)
Aug 12 01:30:57 localhost su: pam_unix(su:auth): authentication failure; logname
=root uid=501 euid=0 tty=pts/0 ruser=cbowman rhost= user=nloring
Aug 12 01:31:18 localhost su: pam_unix(su:session): session closed for user cbow
man
Aug 12 01:32:01 localhost su: pam_unix(su:session): session opened for user cbow
man by root(uid=0)
Aug 12 01:32:11 localhost su: pam_unix(su:auth): authentication failure; logname
=root uid=501 euid=0 tty=pts/0 ruser=cbowman rhost= user=nloring
Aug 12 01:32:15 localhost su: pam_unix(su:session): session closed for user cbow
man
 
Old 08-12-2010, 08:39 AM   #4
cbowman@fnba.com
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Here is an ssh -vvv output plus the tail of /var/log/secure at the end:

E:\dumps>ssh -vvv nloring@172.28.3.237
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to 172.28.3.237 [172.28.3.237] port 22.
debug1: Connection established.
debug1: identity file /home/cbowman/.ssh/identity type -1
debug1: identity file /home/cbowman/.ssh/id_rsa type -1
debug1: identity file /home/cbowman/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-gro
up1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-c
tr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-c
trbug3: tty_make_modes: 7 0
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open
ssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open
ssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: 15
debug2: kex_parse_kexinit: 0
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-gro
up14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour1
28,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-c
tr,aes192-ctr,aes256-ctr38 1
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour1
28,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-c
tr,aes192-ctr,aes256-ctr41 0
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open
ssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open
ssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: 0
debug2: kex_parse_kexinit: 0
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 124/256
debug2: bits set: 540/1024 1
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /home/cbowman/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 3
debug1: Host '172.28.3.237' is known and matches the RSA host key.
debug1: Found key in /home/cbowman/.ssh/known_hosts:3
debug2: bits set: 510/1024nfirm rwindow 0 rmax 32768
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys07:25:48 2010 from 172.28.3.11
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/cbowman/.ssh/identity (0x0)
debug2: key: /home/cbowman/.ssh/id_rsa (0x0)
debug2: key: /home/cbowman/.ssh/id_dsa (0x0)
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-with-mic,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/cbowman/.ssh/identity
debug3: no such identity: /home/cbowman/.ssh/identity
debug1: Trying private key: /home/cbowman/.ssh/id_rsa
debug3: no such identity: /home/cbowman/.ssh/id_rsa
debug1: Trying private key: /home/cbowman/.ssh/id_dsa
debug3: no such identity: /home/cbowman/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
nloring@172.28.3.237's password:
debug3: packet_send2: adding 48 (len 69 padlen 11 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
Permission denied, please try again.
nloring@172.28.3.237's password:
debug3: packet_send2: adding 48 (len 69 padlen 11 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
Permission denied, please try again.
nloring@172.28.3.237's password:
debug3: packet_send2: adding 48 (len 69 padlen 11 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-with-mic,password).


[root@localhost log]# date
Thu Aug 12 01:33:18 EDT 2010
[root@localhost log]# tail secure
Aug 12 00:24:53 localhost su: pam_unix(su:session): session closed for user nlor
ing
Aug 12 01:30:46 localhost su: pam_unix(su:session): session opened for user cbow
man by root(uid=0)
Aug 12 01:30:57 localhost su: pam_unix(su:auth): authentication failure; logname
=root uid=501 euid=0 tty=pts/0 ruser=cbowman rhost= user=nloring
Aug 12 01:31:18 localhost su: pam_unix(su:session): session closed for user cbow
man
Aug 12 01:32:01 localhost su: pam_unix(su:session): session opened for user cbow
man by root(uid=0)
Aug 12 01:32:11 localhost su: pam_unix(su:auth): authentication failure; logname
=root uid=501 euid=0 tty=pts/0 ruser=cbowman rhost= user=nloring
Aug 12 01:32:15 localhost su: pam_unix(su:session): session closed for user cbow
man
Aug 12 01:34:07 localhost sshd[8121]: Failed password for nloring from 172.28.3.
11 port 6067 ssh2
Aug 12 01:34:16 localhost last message repeated 2 times
Aug 12 01:34:16 localhost sshd[8125]: Connection closed by 172.28.3.11
[root@localhost log]#
 
Old 08-12-2010, 09:07 AM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
"Failed password" - are you sure you're typing in the password correctly? Try resetting it.
 
1 members found this post helpful.
Old 08-12-2010, 10:43 AM   #6
cbowman@fnba.com
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Got it, I was using 'usermod' to change the password and sending it a clear text password. I used passwd and I can now log in.
Thanks for directing my steps.
 
Old 08-12-2010, 03:31 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by cbowman@fnba.com View Post
I am able to ssh as root
You understand that really is a bad practice, right?
 
Old 08-13-2010, 08:02 AM   #8
cbowman@fnba.com
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
You understand that really is a bad practice, right?
Yes, which is why it was an issue that I could not log in with any other login. Next step is to disallow root from remote logins.

Thanks
 
  


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
Fedora 12 cannot log in as root, cannot su nor log into bash Neo-New Fedora 7 06-24-2010 12:48 PM
NFS Root setup - can't log in as root after CHMOD ? gallwapa Linux - General 1 04-02-2007 04:31 AM
Cant only log in as root after user log-in. ADJenkins Linux - General 2 11-17-2004 04:18 PM
Log Out root Then Log In As Other User xtremcoder Linux - General 4 10-04-2004 11:01 PM
Log on as Root, or switch to Root, in MDK 9.1 - KDE 3.1.0 snorky Mandriva 3 09-01-2003 12:07 PM

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

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