Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can not login as root, can su [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
69_rs_ss
n00b
n00b


Joined: 26 Dec 2003
Posts: 65
Location: NY, USA

PostPosted: Sun Mar 13, 2005 11:09 pm    Post subject: Can not login as root, can su [Solved] Reply with quote

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
View user's profile Send private message
59729
Apprentice
Apprentice


Joined: 21 Jun 2004
Posts: 279

PostPosted: Sun Mar 13, 2005 11:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mark Nye
n00b
n00b


Joined: 14 Feb 2005
Posts: 39
Location: Ithaca, NY

PostPosted: Sun Mar 13, 2005 11:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
tukachinchila
Apprentice
Apprentice


Joined: 11 Mar 2005
Posts: 274
Location: Oregon

PostPosted: Sun Mar 13, 2005 11:35 pm    Post subject: Reply with quote

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:
Quote:
PermitRootLogin

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
View user's profile Send private message
Mark Nye
n00b
n00b


Joined: 14 Feb 2005
Posts: 39
Location: Ithaca, NY

PostPosted: Sun Mar 13, 2005 11:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
69_rs_ss
n00b
n00b


Joined: 26 Dec 2003
Posts: 65
Location: NY, USA

PostPosted: Sun Mar 13, 2005 11:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mark Nye
n00b
n00b


Joined: 14 Feb 2005
Posts: 39
Location: Ithaca, NY

PostPosted: Sun Mar 13, 2005 11:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Mon Mar 14, 2005 12:38 am    Post subject: Reply with quote

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
View user's profile Send private message
69_rs_ss
n00b
n00b


Joined: 26 Dec 2003
Posts: 65
Location: NY, USA

PostPosted: Mon Mar 14, 2005 1:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum