Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
By way of clarification, I think that, when you said you want "to enable auto login as a root," what you actually meant (from your description) what that you want root to be displayed as one of the "user" choices when the display manager request you to log in to the window manager after the boot process is finished and the X-server is started. The fundamental problem with this is, I believe (but I may be wrong), that root's "home"directory is not in /home with all the other users. Instead, root has a separate, independent, "home" directory: /root.
Anyhow, I just did this (on a Fedora 12 system using KDM, so YMMV):
Code:
$ su -
Password:
# ln -s /root /home/root
# ls /home/
Peter root
Then I went to the login manager and root was listed as an available user (after the "exclude user" check box was unchecked).
Note, however, that I did that by starting a terminal session as "root" with the su - command, which will not work on Ubuntu unless you unlock the root login (which you said you did.).
If you can start a "root" terminal session, you can (almost) always start a window manager session for "root" by entering the command startx -- :1, which starts a second X-server on tty8 with "root" already logged in. (It also leaves your non-root session on tty7 running. You can switch between those session with <ctrl>-<alt>-<F7> and <ctrl>-<alt>-<F8> key combinations.)
Note: For session switching to work, you need a /etc/X11/xorg.conf file that contains the following stanza:
Thanks PTrenholme. You are right, Ubuntu is different and even easier in this particular case. You can set up new user called ROOT with full account and it's folder directly in "User and Accounts" manager from administration panel. But even then root still doesn't appear in the login and autologin list. And is no "exclude user"check box in there.
The problem is that root has been locked somewhere in the gdmsetup preferences and is excluded from any settings. I tried to alter custom.conf on my own but it says acces is danied. Even for a root. Is anything above the ROOT? Do we have "Super Root" or God Root" in the linux?
I have sent a message to the link above (thanx bret381) and still waiting for answer.
When have any news will post it here.
Everyone seems to be saying this is a very bad idea to make root autologin. I disagree when this involves autologging in on the physical console. I do agree that casual use of the computer with all root power enabled is a bad idea. My disagreement is regarding the autologin aspect. Certainly it is a VERY VERY bad idea to have root be password-less via net access (unless your goal is to make a "honey pot" system and you should not be doing that if you need to ask how to do this here).
If someone has physical access to the computer, the can probably boot any Live CD or Live USB flash drive of their choice, and be their own root, anyway. There is little protection by requiring a login on the console. This depends on the people in the environment. If you have clueless morons wandering around typing bad commands but who cannot figure out how to get into a computer with a Live CD, then maybe not autologging will be a good thing for you.
If you think you have locked your children out of your computer via a password, and these children can get a Live CD and get to your computer when you are not around, you better rethink the situation (I've heard of someone that runs his server inside a gun safe).
I have set up autologin to root before on a few distributions. I don't have the Ubuntu variation handy. I do this on Slackware by having an entry in /etc/inittab like:
Code:
c1:12345:respawn:/sbin/agetty -n -l /etc/autologin 38400 tty1 linux
where the file /etc/autologin is a script something like what I have:
Code:
#!/bin/bash
pid="$$"
dev=$( /usr/bin/find "/proc/${pid}/fd/0" -maxdepth 0 -type l -printf '%l\n' )
tty=$( echo "${dev}" | /usr/bin/cut -d / -f 3 )
speed=$( /usr/bin/stty -a | /usr/bin/head -1 | /usr/bin/cut -d ' ' -f 2 )
if [[ -x "/etc/autologin-${tty}-OK" ]]; then
echo ""
echo "Welcome to `exec uname -s` `exec uname -r`."
echo ""
echo "`exec uname -n` login: root"
echo "Password:"
cd /root
export AUTOLOGIN=1
export AUTOLOGIN_DEV="${dev}"
export AUTOLOGIN_TTY="${tty}"
export AUTOLOGIN_SPEED="${speed}"
exec /bin/su -
fi
if [[ -c "${dev}" ]]; then
exec /sbin/agetty "${speed}" "${tty}" linux
fi
echo "Unable to enable console ${dev}"
if [[ -x /bin/sleep ]]; then
exec /bin/sleep 3600
fi
exec /usr/bin/sleep 3600
You can customize it to suit your needs. If you system (e.g. Ubuntu) does not use /etc/inittab, you'll need to find another way to fit this in. Grep around for files that have "getty" in them as they may be what gets run, or read, to perform login startups.
If the distribution has a Live CD available, you can also pick apart the Live CD to see how it is done in there.
If you want a graphical autologin, this goes beyond my experience. See the previous paragraph.
Thank you Skaperen. The file you described in Ubuntu is called GETTY. You can find it in
/sbin/getty
It's quite big file, I give it more attention later because I have found something in the other place. In fact it not fulfills exactly what I expected of it, but final effect is same.
The file which keep the secret is "custom.conf" but let's start from beginning.
In the new installed and updated system log in as a ordinary user.
Open terminal and type:
[sudo passwd root
when prompt type your password
when prompted type new root password
when prompted retype new root password
Then restart and log in as a ROOT.
Open "Users and Groups" in "administration tab"
Select "root" and go to "Advanced Settings".
Tick all possible "User Privileges".
Close and go to "Login Screen" in "administration" tab.
Click unlock, type password and mark "login as" option.
It doesn't matter that root is not listed, just leave it and click "close".
Open terminal and type:
Then save it, close gedit, and restart system.
If everything was going fine so far you should be directly loged to the system as ROOT and not even see "login" window.
Graphic is not the issue as I have what I wanted.
It's not big thing and solution came fairly easy. By me it's no point to keep it hidden in the bottom of the system, out of reach of other users. For people like me it's saves time and nerves and should be commonly accessible for every member of community in "login window". I made some suggestions to the proper people, hopefully it will be corrected in the future updates.
I think the OP understands that it is a bad idea, but his question was not "Is it a good idea to auto login as root" it was "How to enable auto login as root".
There is always plenty of of obsessive people on the every forum who care about your safety more than yourself. But don't worry, I am use my system only in root mode for months and have no problems with it, so you are free to use it your way. Just follow the instructions in previous post dated 01-04-10. Create root and edit "custom.conf".
Good Luck.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.