Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm setting up a PC for a very specific purpose. It's going to do some stuff deep underwater... round about 3km. We don't fear fish hijacking the box locally ;).

I'm trying to set up a login: no Xserver. Works well... I edited gdm.conf not to start. Great: that's how Linux is supposed to be in the first place.

Now my next and last task is: get the login. I googled upstart, event.d - my 10.4 distribution I recently installed doesn't have this or it doesn't work like I expect. I want the box to boot and to provide a local root shell. Just that...

How is this possible?

edit: possible tags: headless, auto-login. Can't set that....

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

If you just want the box to start up with a root console, why running login in the first place? You can bypass it and just start a shell on any TTY.

Programs running on the text consoles tty1 to tty6 are configured in the files /etc/init/ttyX.conf. Now, the getty program accepts a -l option to specify a program to start (default in /bin/login) - you can specify /bin/sh instead, and get a root shell. You need to give the -n option as well, to prevent getty from prompting for the user name.

Wrapping up: edit /etc/init/tty1.conf and replace the exec /sbin/getty ... line with:

exec /sbin/getty -n -l /bin/sh -8 38400 tty1

Same for tty2, tty3, ...

share|improve this answer
1  
I suggest /bin/bash, dash is almost unusable from command line. –  enzotib Oct 20 '10 at 14:48
    
how do you automatically load .bashrc while auto login? –  c2h2 Jun 11 '12 at 4:01
    
@c2h2: the .bashrc file is loaded by the bash shell itself -- irrespective of whether the login was automatic or not. (Actually, bash reads .bash_login and .profile files when it's a login shell, and .bashrc if it's not a login shell.) –  Riccardo Murri Jun 13 '12 at 9:02
    
ok thanks, but it seems i followed you methods, but PATH and various other settings are not loaded automatically. –  c2h2 Jun 13 '12 at 9:23
add comment

To actually enable root logins, you have to set a password for the root account and then unlock the locked root account. If you don't set a password for the root account the passwd command will return

passwd: unlocking the password would result in a passwordless account.  

So, first execute in a terminal:

sudo passwd root

you will prompted for a new Unix password. Write it twice(second for confirmation). Then execute:

sudo passwd -u root 

to unlock the account. This should return

passwd: password expiry information changed

Reverting back

If you want to disable root account in Ubuntu you need to lock the root account by using the following command:

sudo passwd -l root

Second:

Open the terminal and type:

gksudo gedit /etc/ect/lightdm/lightdm.config

(Orignal ) this it what it should already look like

SeatDefaults] 
greeter-session=unity-greeter          
user-session=unity                         
greeter-show-manual-login=true 
greeter-show-manual-login=true 

(What you need to replace the original with)

[SeatDefaults] 
autologin-user=<YOUR USER> 
autologin-user-timeout=0 
user-session=ubuntu 
greeter-session=unity-greeter 
share|improve this answer
    
The OP stated clearly "no X11". –  Rmano Mar 12 at 4:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.