LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Login issue. Can't login as root (https://www.linuxquestions.org/questions/linux-newbie-8/login-issue-cant-login-as-root-569707/)

sqldbg 07-16-2007 01:59 AM

Login issue. Can't login as root
 
Hi,

I've just installed redhat 4 on a virtual pc on my windows laptop. When linux boots up into the graphical login and I try to login as "root" I get told root logins are not allowed.

When I follow the instructions on the redhat site to set it to single user I get "kernel panic - not synching: attempted to kill init!"

Any suggestions much appreciated. :)

Thanks,

mjuhannus 07-16-2007 03:01 AM

If you truly for some reason have to login as root, which usually isn't necessary, you can allow root logins.

You must change line
AllowRoot 0

to

AllowRoot 1

in your /etc/X11/gdm/gdm.conf -file

sqldbg 07-16-2007 05:03 PM

Thanks.

But its a fresh install. There are no other users other than root.

How do I change the file when I can't login at all?

IsaacKuo 07-16-2007 05:18 PM

There should be one regular user in a fresh install.

Gortex 07-16-2007 08:33 PM

what if you just pass linux 1 at the boot loader ?

mjuhannus 07-17-2007 02:22 AM

I think runlevel 1 didn't work, but you can press ctrl+alt+f1 when you get to the login screen to get to an terminal. From there you should be able to login. Just the graphical logins are not allowed.

b0uncer 07-17-2007 02:32 AM

There should really be no need for a graphical login for root. All the tasks you need to do can be done with a regular user, with some certain things ran with root privileges (still not lot logging in as root). The preferred way to do things with root privileges without logging in as root is to use sudo. Configuration consists of modifying /etc/sudoers to allow some user(s) run some command(s) with sudo, and perhaps - if needed - by adding those users that need to run sudo to the 'sudo' group. There's a temptation to configure sudo so that some users can run anything with it, possibly even without typing a password, but that's as dangerous as telling your root password in public.

- make sure sudo is installed
Code:

which sudo
- configure /etc/sudoers for your needs; only add those users (or rather just one user) that can't live without being able to do something as root, and only give them access to the exact commands they need to run. Note that allowing them to run a shell or 'su' as root lets them access root account with full permissions to everywhere.
[code]su
gedit /etc/sudoers[code]
(use any text editor instead of 'gedit' if you like)
- try if it works; if it doesn't, adding the user in hand to 'sudo' group could help, depending on the configuration
Code:

sudo /sbin/iptables -L
The above would print iptables current rules, and isn't (or shouldn't be) available for non-root users by default.


All times are GMT -5. The time now is 10:13 AM.