5

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....

2 Answers 2

6

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, ...

4
  • 1
    I suggest /bin/bash, dash is almost unusable from command line.
    – enzotib
    Oct 20, 2010 at 14:48
  • how do you automatically load .bashrc while auto login?
    – c2h2
    Jun 11, 2012 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.) Jun 13, 2012 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, 2012 at 9:23
1

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 
1
  • 2
    The OP stated clearly "no X11".
    – Rmano
    Mar 12, 2014 at 4:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .