# cannot login as root anymore [SOLVED]

## master.of.disaster

hello 

got a strange problem here ...

after rebooting my little server I couldn't log in as root anymore. I always get "login incorrect" ...

when I su from a normal user everything works fine. so I sued to root and changed the root password -> no errors, but when I try to log in as root I still get the "login incorrect" error!

any ideas? 

thanx for your help!

MarcelLast edited by master.of.disaster on Wed Sep 01, 2004 3:44 pm; edited 1 time in total

----------

## benesm1

Are you logging in locally or from SSH? In case of ssh it is a preffered behavior, in case of local login look at /etc/securetty, whether the terminal you are logging from is listed.

----------

## G3n2

if not from ssh , try booting from the livecd , chrooting into ur gentoo box:

chroot /mnt/gentoo /bin/bash (and whatever else comes b4 and after this command)

then type : 

```

passwd

```

u will be prompted 2 times for a pass , type ur new pass and reboot , hf  :Wink: 

----------

## master.of.disaster

thanks for your replies!

I'm login in locally (not via ssh) and the /etc/securetty seems to be ok.

I already tried booting from livecd and changing the root password as you described. seemed to work perfectly, but didn't change this strange behaviour! looks like the password didn't get changed   :Smile: 

I have absolutely no idea what is happening with my machine   :Confused: 

any other ideas?

----------

## polle

just a shot in the dark:

you didn't accidently change your keyboard layout?

----------

## etnoy

Perhaps you can post your first line of /etc/passwd, containing the entry for root?

----------

## master.of.disaster

@polle: good idea, but it's not that!

I have no experience with password files ...

this is the first line of /etc/password:

```

root:x:0:0:root:/root:/bin/bash

```

no idea if this entry is fine or not! what's the meaning of these arguments?

----------

## master.of.disaster

something else which might be connected to this problem:

I have pure-ftpd installed and when I try to create a new (virtual) user I always get the error: 

```
check that ["user"] doesn't already exist, and that [/etc/pureftpd.passwd.tmp] can be written
```

the weird thing is that pureftpd.passwd.tmp didn't even exist when this error occured the first time (created an empty file afterwards) ...

I tried with different users who surely didn't already exist!

any ideas?

----------

## polle

mayb it's your pam configuration:

 *Quote:*   

> /etc/security/access.conf can be used to restrict access by terminal or host. The following must be placed in /etc/pam.d/login in order for these examples to work: 
> 
> account    required   /lib/security/pam_access.so
> 
> Deny steve login access on all terminals except for tty1: 
> ...

 

----------

## master.of.disaster

I don't have any entries in /etc/security/access.conf  (only --> #   what is this called in english? comments?   :Smile:  )

 "account required /lib/security/pam_access.so" doesn't exist in my /etc/pam.d/login ...

you say it CAN be used to restrict access. I suppose if I haven't restricted anything this shouldn't be the problem ... or am I wrong?

something else besides: I'm able to change the root password when sued to root, but it still does not work when I try to log in as root directly!

----------

## master.of.disaster

configured ssh now ... 

strange behaviour there too: always get an access denied no matter with which user I try to log in ...

----------

## master.of.disaster

problem solved!    :Very Happy: 

/etc/securetty was set writable for user and world   :Rolling Eyes: 

don't ask why ... suppose I was tinkering around and ... yeah ...

think I'll check my system for other wrong chmoded files!

thanks for your replies and help!

----------

## Jhurleston

 *Quote:*   

> etc/securetty was set writable for user and world 

 

I have -rw------- on securetty, is this correct?

and how did you change it.

 :Mad: 

Also would it be wise to add a normal user and then su into the root?

----------

## master.of.disaster

can't say if it's right or wrong - but it's certainly not really bad   :Very Happy: 

I have -rw-r--r-- 

to change rights of a file u can use the command "chmod" 

--> chmod 644 filename

(that's  -rw-r--r--) 

I'm not sure if I understood your second question ...

you should create a "normal" user for all-day use!

you should not work with root if it's not needed ... 

normally you are logged in with a normal user and su to root when you need root permissions ...

you'll need that to add a user: 

```
useradd username -m -G users,wheel,audio -s /bin/bash 
```

wheel --> so you can su to root

audio --> suppose otherwise your user won't be able to hear anything

-s /bin/bash --> console access for this user

----------

## Jhurleston

I'm making a dum terminal, got  an idea and want to test it out.

I've built a strage3 from a Universal Livecd 2004.2

using gentoo-sources.

basicay you answered my second question.

usermod -G users,wheel username

should solve my problems.

----------

## Jhurleston

Thanks master.of.disaster, thats solved my problem !

 :Cool: 

Even though you didnt understand my second question. I now have access.

Now for the next problem.

How to install: Apache, Php and mysql and proberbly ssl too.

 :Question: 

----------

## master.of.disaster

hey juhrleston 

glad to hear that your system's working   :Smile: 

installation of these apps is easy - just emerge it .. as far as I remember there shouldn't be anything special with apache, mysql and php ...

emerge will install apache version 2 -> that's better because (if I remember correctly) everything for setting up ssl for your webserver (mod_ssl) should get installed automatically with it! you might want to install openssl -> to create your own keys and certificates ...

php shouldn't make any troubles anyway ...

with mysql I would recommend to do the post-install (setting up the users and change the standard users/password) very carefully 

what else? hmm   :Very Happy:    ssh would certainly be nice (it's running very nicely on my server) so you can remotely administrate your server ...

and yes: you probably want to install a ftp server ... I'm using pure-ftpd which I like pretty good ...

my machine's running with the gentoo-dev-sources (kernel 2.6.7) --> faster ... but I think there are more stable and especially better optimized kernels for servers avaible --> read the kernel guide or search the forums if you want to know ...

good luck!

----------

