LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can you log in as root automatically? (https://www.linuxquestions.org/questions/linux-software-2/can-you-log-in-as-root-automatically-55166/)

ludwig W 04-15-2003 01:00 PM

Can you log in as root automatically?
 
I mean,from boot up,can you boot straight in as root without having to enter 'root' and a password each time?

david_reno 04-15-2003 01:54 PM

More info please. Why do you want to do this? Do you want something like MS-Windows has that frees you from the effort of typing a password everytime? If so, you should pursue automatic login of a user account (note: I don't know if that's possible).

Are you thinking of loging in to a window manager (i.e. X windows), or just a psuedo terminal session?

david_ross 04-15-2003 01:59 PM

Yes but it's dangerous so don't!

jetblackz 04-15-2003 02:00 PM

Yes, but that defeats the purpose of Linux's security. It's same as giving the keys to your house and car to everybody.

If you're so inclined to do it, go to KDE, Control Center, Login...

Proud 04-15-2003 02:01 PM

You should not be logging in as root each time. Most distros force you to make a seperate 'everyday use' account. You'll only complain when you screw something up while as root.
Use the su command when you need root access.

Linus VanPelt 04-15-2003 05:05 PM

I know it is a pain when you are doing a lot of software installing, but you should never log in directly as root. Always su or run an X-Windows program that requires the root password in order to execute.

Logging in as root, or staying in root all the time, is extremely dangerous.

Oh, and don't make your root password the same as your user account password.

ludwig W 04-15-2003 05:25 PM

ok,
I've got a big problem here:

I installed RH8 about 3 weeks ago,and every now and then, the stuff I tried to install,asked me to be root.So i figured I might as well stay root all the time.

Why is it dangerous to do so?


Ok,on to my problem:
II just created a user account and I've found that the programs I've installed as root don't work for the user account :confused:
What's more,the internet connection i spent 2 weeks trying to get to work (PPP over ATM ADSL modem) doesn't work from the user account.

Is it the case that anything I did as root won't work for a user? Am I going to have to go back and re-do everything I did as root and re-do it for the new user account?

EvilTwinSkippy 04-15-2003 05:34 PM

Use Single User Mode
 
At startup invoke single user mode.

From lilo: add "single" to your "linux" option.

From grub, edit the bootloader for your linux installation, and add "single" to the end of the line that has your kernel statement. (Follow the on-screen instructions.)

I had the same problem a while back with a dialup server.

Failing that, light up the RedHat installer, and use rescue mode. Use the option to mount your system under /mnt/sysimage.

When you get to the prompt:
chroot /mnt/sysimage
passwd root

QED

ludwig W 04-15-2003 06:23 PM

Quote:

From grub, edit the bootloader for your linux installation, and add "single" to the end of the line that has your kernel statement.
Can you tell me exactly how it should look.
Should i just have :

title Red Hat Linux (2.4.20)
root (hd0,1)
kernel /boot/vmlinuz-2.4.20 ro root=LABEL=/ hda=ide-scsi/single
initrd /boot/initrd-2.4.20.img
, in grub.config ???


(here,I added '/single' to the end of the kernel line)
Thx
Ludwig

EvilTwinSkippy 04-15-2003 07:51 PM

Quote:

Originally posted by ludwig W
Can you tell me exactly how it should look.
Should i just have :

title Red Hat Linux (2.4.20)
root (hd0,1)
kernel /boot/vmlinuz-2.4.20 ro root=LABEL=/ hda=ide-scsi/single
initrd /boot/initrd-2.4.20.img
, in grub.config ???


(here,I added '/single' to the end of the kernel line)
Thx
Ludwig


kernel /boot/vmlinuz-2.4.20 ro root=LABEL=/ hda=ide-scsi single

(Note no slash)

ludwig W 04-16-2003 02:00 AM

thx mate.I'll give it a go.

One thing:
can you tell me exactly what this does :confused:

Does it enable a created user profile to access things only root could before?


sorry,I'm a bit confused.

cheers
Ludwig

EvilTwinSkippy 04-16-2003 06:07 AM

How Single Mode Works
 
SINGLE is actually a cue for the system to start up in runlevel 1, which bypasses all services and stops after mounting the file systems.

This is particularly useful in cases where one of your daemons is crashing the computer on startup, or you need to do some SERIOUS vodoo on the file system.

On public machines I will usually put a password on the grub loader. I work at a science museum. Kids are constantly finding new ways of breaking things. That and no power of destruction compares to a bored teenager.

EvilTwinSkippy 04-16-2003 06:10 AM

I looked at my last post an realized I never actually answered you question.

You are actually running as root in single mode. INIT (the master of all processes) startups up BASH instead of the normal login process. You are operating as if you had logged in as root, and had turned off (or more accurately never started) all of the processes in /etc/init.d.

I generally log into single user mode long enough to reset the root password and then reboot.

ludwig W 04-16-2003 11:50 AM

Ok,
I'm getting a bit lost here.

My problem is that after setting up my Linux install as root all the time,when I got sick of typing out passwords and user name at each boot, I created a user account.Now, with this user account,I can't run or access most of the stuff I've set up whilst I was root.

Will this 'single' thing fix that or do I really have to start all over again?
You say
Quote:

SINGLE is actually a cue for the system to start up in runlevel 1, which bypasses all services and stops after mounting the file systems
Why would I want to do that?I mean, stopping all services is not a good thing,right? I would have thought I would want services running,would I not?:confused:

Sorry,but I've lost the thread of what you are saying or suggesting.

Ludwig

david_ross 04-16-2003 12:36 PM

I have no idea what "EvilTwinSkippy" is talking about. You only need to boot into single user mode for trouble shooting systme problems and changing the the root password if you forget it.

To answer you other question - It is dangerous to login as root because the root account has permissions to delete system files. For instance on windows 98 any user could login (without any password except bios) and delete C:\autoexec.bat - this would stop the system booting. In linux deleteing system files can only be done by root as only root is given permission to modify the files.

As for you problem with not being able to run programs you have installed - If they are system configuration programs you probably do need to run them as root (again for security). If it is a text editor or web browser etc then it is probably a permssion problem.

There are three types of permissions - read, write, execute. There are also three types of user - owner, group and other. Other is everyone and so most programs are set so that only root can read write and execute but other (everyone) can execute. eg
chown root FILE
chgrp root FILE
chmod 775 FILE

Look at "man chown", "man chgrp" and "man chmod" for more information.


All times are GMT -5. The time now is 09:46 PM.