Link to home
Start Free TrialLog in
Avatar of kennyhenao
kennyhenao

asked on

Can not login into RHEL

When i log in with my root account the system just goes ahead and prompts me again for the username and password. I tried to go into single user mode and reset the root password and that still did not work. I received the same issue. I created a new user in single user mode and still had the same problem. I do not know what else to try. I have read about it might be the login scripts are corrup but i do not know how to fix that. thanks!
Avatar of nognew
nognew
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi kennyhenao!
 Are you trying to login into a text mode terminal screen or XWindow mode?
 Are you trying to login from remote or locally?
1. Check if your users home directory exists.
2. Check if your shell exists where it tries to find it.

Cheers,
t.
Avatar of kennyhenao
kennyhenao

ASKER

I'm trying to log into text mode on the terminal screen. How do i check the rest?
if you can login ina single mode:
do :
cat /etc/passwd

from the output you can identify which shell your user on and which home directory it is.
Ex:
gdm:x:112:119:Gnome Display Manager:/var/lib/gdm:/bin/false
agile:x:1000:1000:Agile,,,:/home/agile:/bin/bash

in the example above you can find a used gdm home directory: /var/lib/gdm and he has no shell, which is: /bin/false so that user can't login.
User agile home directory is /home/agile and shell is /bin/bash
That user can login.
Your aim is to identify the home dir and shell for your user and check if they exist.
You can check home dir existence by issuing ls command against home dire path.
You can check you shell works by executing shell command: /bin/bash for instance in that example.
Kind regards,
T.
Avatar of rindi
Were you able to get in using single user mode, or was the login unsuccessful there too?

If you did manage to login, check the free space on your partitions. Logins will often fail if you don't have enough free space. Also check whether all partitions mount properly.
rindi how do i check free space from single user mode and that the partitions mount correctly?
nognew

when i do a ls /bin/bash it just shows me /bin/bash in green. This is for the root user. He has bin bash and the home directory is /root.

when i type /bin/bash in the command line it just takes me back to the # prompt.
That is correct, that means everything works as it suppose to.
 Can you look into your syslog and messages files in /var/log directory to see what messages are logged there on your unsuccessful login attempts?
Cheers,
t.
df should show your disk-space. If all your standard directories are there and accessible, they should have mounted properly. As mentioned above, the logs should give you a better idea.
what am i looking for in the messages log file?
you should see your logging attempts and the reason they are rejecteed. Check syslog as well.
t.
what command should be used to view the logs and be able to scroll or go page up or down?
you can use "less". To scroll up/down just use arrows. To go to the bottom of the file "Shift-G", to the top "g".
If you type /<search word >ENTER you can search through the file.
To find next string just press n, to search bottom to the top press Shift-N
Cheers,
t
is that using cat?
no you supply the file to less command as a parameter.
Ex:
less /var/log/messages

Cheers,
t.
i searched in messages for error or root and i did not find anything. also i tried /var/log/syslog and it says file not found.
Can you see file called auth.log in your /var/log directory? If you can try to less that file.
You might not see error messages, but messages which explain why login has not succeeded. That can be pretty legitimate reason.
t.
no such file or directory is what it says.
can you execute ls -altr |tail -10 in your /var/log directory and post output here?
Cheers,
t.
The output is.

-rw------- 1 root utmp  147526272 Sep 17 17:07 btmp
-rw------- 1 root root            68060 Sep 17 17:10 cron
-rw-rw-r-- 1 root root           19539 Sep 17 17:11 TTY_00000000.log
-rw-r--r-- 1 root root              1481 Sep 17 17:11 dsm_om_connsvc32dIO.log
-rw------- 1 root root            36292 Sep 17 17:11 secure
-rw-r--r-- 1 root root              8778 Sep 17 17:11 acpid
-rw------- 1 root root          967718 Sep 17 17:11 messages
-rw-rw-r-- 1 root utmp       656640 Sep 20 11:46 wtmp
-rw-r--r-- 1 root root            35189 Sep 20 11:46 dmesg
drwxr-xr-x 18 root root          4096 Sep 20 13:25 .
Hi,

When root unable to login into the system think.
1.Is passwd correct?
2.Is Account expired?
3.Is Terminal blocked?

So, Do the following steps:-
-> Boot the system in single user mode.
->  Change the password.
->check the account expired date by using chage -l root command.
if account is expired , set net expire date: chage -E "NEVER" root.

1. Check the file /etc/securetty which file blocked to root login form the certain terminal.
2. If Terminal is deleted or commented write new or uncommet.
3.Reboot the system and login as root.

Cheers,
Mohan
Hi there!
 can you check if you got something in /var/log/dmesg file? Though it is very unlikely.
Can you do su - <your other user> from root?
Cheers,
t.
ASKER CERTIFIED SOLUTION
Avatar of kennyhenao
kennyhenao

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you want to accept that as the solution you should add more details, like which system file he edited and what the wrong entry was. Otherwise you should rather ask for a delete / refund.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial