LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
Search this Thread
Old 03-29-2010, 12:27 PM   #16
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,149

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330

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:
Code:
Section "ServerFlags"
        Option      "DontZap" "off"
        Option      "DontVTSwitch" "off"
        Option      "HandleSpecialKeys" "Always"
EndSection
 
Old 03-30-2010, 03:54 PM   #17
cimek
LQ Newbie
 
Registered: Nov 2008
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 03-30-2010, 04:18 PM   #18
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 115Reputation: 115
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.
 
Old 03-30-2010, 06:32 PM   #19
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,240

Rep: Reputation: 121Reputation: 121
What are you doing that you have to be root/sudo so often that it's an aggravation?
 
Old 03-30-2010, 06:50 PM   #20
John VV
Guru
 
Registered: Aug 2005
Posts: 12,808

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
What are you doing that you have to be root/sudo so often that it's an aggravation?
i was thinking the same

now it is nice to be able to login as root every now and then ( restoring from back-up and things like that)

nautilus - gnome and dolphin - kde can be started from the terminal as root even though you might be loged in as a normal user

installing software is for the most part the main reason ( pacman,yum,... ) or configure ,make " su " make install

reading some log files like
/var/log/errors.log and iptables.log ( need to be root )
 
Old 03-31-2010, 06:53 PM   #21
cimek
LQ Newbie
 
Registered: Nov 2008
Posts: 10

Original Poster
Rep: Reputation: 0
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:

gedit /etc/gdm/custom.conf

In Gedit window change settings to:

TimedLoginEnable=false
AutomaticLoginEnable=true
TimedLogin=user
AutomaticLogin=root
TimedLoginDelay=30
DefaultSession=gnome

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.

Thanks everyone for every little help.
 
Old 04-27-2010, 11:26 AM   #22
doctor_ahmed
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 0
How did you solve it please
i'm interesting the same gole
i searched to much to fix it
if you have solve it please help me

i'm using ubuntu 9.10 and want to autologin as root instead typing choosing it from login menu and writing password every login
 
Old 04-27-2010, 01:13 PM   #23
John VV
Guru
 
Registered: Aug 2005
Posts: 12,808

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
to clarify -- this is for "doctor_ahmed"
Quote:
i'm using ubuntu 9.10 and want to autologin as root instead typing choosing it from login menu and writing password every login
read the thread
DO NOT do that "root auto login "is not a good idea

Last edited by John VV; 04-27-2010 at 01:27 PM.
 
Old 04-27-2010, 01:25 PM   #24
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 547

Rep: Reputation: 115Reputation: 115
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".
 
Old 04-27-2010, 01:41 PM   #25
cimek
LQ Newbie
 
Registered: Nov 2008
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 04-27-2010, 03:17 PM   #26
doctor_ahmed
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 0
thanks for rapid follow up
thanks again cimek because you can understand me
that's great thing that not write password any more

i alread do it 2 minutes after i wrote the first post
I've found the method at a turkish blog

Greet cimek i have not see your method at first time
it is the same method

Last edited by doctor_ahmed; 04-27-2010 at 03:23 PM.
 
  


Reply

Tags
auto, login, lucid, root


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding root privaliges to user accounts or auto login as root Val-Ent Linux - General 15 03-02-2010 04:27 PM
How to enable auto login using a shell script gauravtiwari21 Linux - Security 4 10-20-2007 02:55 AM
How to enable auto login for root in Redhat alix123 Programming 5 06-27-2007 12:43 AM
auto login as root Whisky_Drinker Linux - Newbie 15 01-19-2005 04:20 PM
Auto login once as root... dano1970 Linux - General 2 10-28-2004 05:19 AM


All times are GMT -5. The time now is 05:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration