View previous topic :: View next topic |
Author |
Message |
69_rs_ss n00b
Joined: 26 Dec 2003 Posts: 65 Location: NY, USA
|
Posted: Sun Mar 13, 2005 11:09 pm Post subject: Can not login as root, can su [Solved] |
|
|
I just finished install on a new box and for some reason I can not log in as root. When trying to login, it gives me a login incorrect error. When I log into the box as a regular user and the try to su, it logs in correct. Although I never log in as root, I would like to figure out how to correct this. Thanks in advance.
Last edited by 69_rs_ss on Mon Mar 14, 2005 1:00 am; edited 1 time in total |
|
Back to top |
|
|
59729 Apprentice
Joined: 21 Jun 2004 Posts: 279
|
Posted: Sun Mar 13, 2005 11:29 pm Post subject: |
|
|
I am sure someone else can answer your question just wanted to drop in and tell you that it's a good thing to now allow root logins..
A while back when I got back from a vacation I checked my auth.log I found one ip trying to login to my box 'he had been doing it for a couple of days' , doing a 'grep -c root auth.log' revealed that he/the script? tried to login well I don't remember but it was alot around ~8000 or more times
If you still want to allow it and no one has answered when I awake tomorrow I will take a look at my config and post it |
|
Back to top |
|
|
Mark Nye n00b
Joined: 14 Feb 2005 Posts: 39 Location: Ithaca, NY
|
Posted: Sun Mar 13, 2005 11:32 pm Post subject: |
|
|
You could try first just su'ing to root and changing your root password. That might do it.
It's possible also to disable root login in the /etc/securetty file, so you could take a look there.
Are we talking just a regular terminal login, or are you trying to log in with SSH or under X11? |
|
Back to top |
|
|
tukachinchila Apprentice
Joined: 11 Mar 2005 Posts: 274 Location: Oregon
|
Posted: Sun Mar 13, 2005 11:35 pm Post subject: |
|
|
Are you trying to log in directly, or through ssh?
If you're trying to ssh in, there's an option in the config file:
Change that to "yes" and you should be able to login as root.
If you can't login locally, check the settings in /etc/security/access.conf
It is more secure to su - if possible, or better yet make use of the sudo program to avoid logging in as root. |
|
Back to top |
|
|
Mark Nye n00b
Joined: 14 Feb 2005 Posts: 39 Location: Ithaca, NY
|
Posted: Sun Mar 13, 2005 11:37 pm Post subject: |
|
|
Quote: | A while back when I got back from a vacation I checked my auth.log I found one ip trying to login to my box 'he had been doing it for a couple of days' , doing a 'grep -c root auth.log' revealed that he/the script? tried to login well I don't remember but it was alot around ~8000 or more times |
If you can, it's useful to firewall your SSH port against all but trusted IP addresses. Of course depending on your situation it might not be possible, but I know it helps me sleep a little better at night! |
|
Back to top |
|
|
69_rs_ss n00b
Joined: 26 Dec 2003 Posts: 65 Location: NY, USA
|
Posted: Sun Mar 13, 2005 11:42 pm Post subject: |
|
|
This is just trying to log in directly, not through ssh. I have yet to set up ssh on this box, just trying to complete the initial install. Since I don't log in directly as root much anyway, it isn't a big issue since I can log in as a regular user and the su up. I was just curious of a way to fix this. I will try su'ing then changing the password as soon as xorg is done emerging. Thanks for the help so far. |
|
Back to top |
|
|
Mark Nye n00b
Joined: 14 Feb 2005 Posts: 39 Location: Ithaca, NY
|
Posted: Sun Mar 13, 2005 11:57 pm Post subject: |
|
|
Quote: | I will try su'ing then changing the password as soon as xorg is done emerging. Thanks for the help so far. |
You know you can switch to a different terminal while xorg is building by pressing ctrl-alt-F2? (and F3, F4, etc.) You can log in again and do other work, then come back to your original session with ctrl-alt-F1. |
|
Back to top |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Mon Mar 14, 2005 12:38 am Post subject: |
|
|
You can disable login in as root from console in the /etc/securetty file. By default it should be ok, but if you did echo "tts/0" > /etc/securetty instead of echo "tts/0" >> /etc/securetty you will have overwritten it.
Code: | [root@edder ~ ]$ cat /etc/securetty
# /etc/securetty: list of terminals on which root is allowed to login.
# See securetty(5) and login(1).
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
vc/12
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
tty12 |
|
|
Back to top |
|
|
69_rs_ss n00b
Joined: 26 Dec 2003 Posts: 65 Location: NY, USA
|
Posted: Mon Mar 14, 2005 1:00 am Post subject: |
|
|
That worked perfectly BlackEdder. I checked the /etc/securetty file and it only listed tts/0 so I just used the config you posted and copied it into mine. After login out and trying again, it worked perfectly. Thanks for everyones help. |
|
Back to top |
|
|
|