It is required that when booting the Linux machine (Ubuntu 10), it automatically logs in as root in the console. There is no graphical shell.

Tell us how this is done? On the Internet of information at least and all outdated.

  • one
    Is this to be done for "convenience"? (Then it greatly compromises the system) Or is it necessary to perform certain tasks? (Then login to the console is not necessary). - Yaroslav Nov.
  • @Yaroslav Yes, it is necessary to perform specific tasks. This is the board on which the script should automatically run / turn on X / run software when turned on. At the moment, this all happens by login and is written in ./bashrc. It remains to log in :) As for security, you can not worry about the network on it, no, Claudia too. - Mira Nov.
  • one
    Maybe you need to correctly configure the system to start automatically? not automatically enter username / password - Yaroslav
  • one
    @alexanderbarakin, if distr from sistemd, then rklokal does not plow. You need to either allow it or write a service. - don Rumata
  • one
    @donRumata, well, with your version of ubunt everything is clear , but what exactly the author’s problem is is unclear. - aleksandr barakin

1 answer 1

advance notice:

This is an answer directly to the question, and the author of the question, judging by the content of the comments, needs a very, very different thing - to find out why he does not run the /etc/rc.local script. but this is a completely different question.


On the Internet of information at least and all outdated.

this is not entirely true. For many years in popular distributions on the first few (usually from the first to the sixth) virtual terminals usually run the same agetty or mingetty programs .

and both have the option --autologin имя-пользователя (some implementations are -a имя-пользователя ), which does exactly what its name implies.

another thing is that it is not always easy to determine exactly where the file is located, which describes the launch of *getty . to add an option to invoking the correct *getty instance.

  1. in the “good old” sysv initialization, this, of course, is the /etc/inittab :

     $ grep -v '^#' /etc/inittab | grep getty 1:2345:respawn:/sbin/getty 38400 tty1 2:23:respawn:/sbin/getty 38400 tty2 3:23:respawn:/sbin/getty 38400 tty3 4:23:respawn:/sbin/getty 38400 tty4 5:23:respawn:/sbin/getty 38400 tty5 6:23:respawn:/sbin/getty 38400 tty6 
  2. in the upstart initialization system, this role seems to be played by the /etc/init/tty?.conf files:

     $ grep -v '^#' /etc/init/tty?.conf | grep getty /etc/init/tty1.conf:exec /sbin/getty -8 38400 tty1 /etc/init/tty2.conf:exec /sbin/getty -8 38400 tty2 /etc/init/tty3.conf:exec /sbin/getty -8 38400 tty3 /etc/init/tty4.conf:exec /sbin/getty -8 38400 tty4 /etc/init/tty5.conf:exec /sbin/getty -8 38400 tty5 /etc/init/tty6.conf:exec /sbin/getty -8 38400 tty6 
  3. In systemd, the situation is somewhat more complicated . As far as I understand, looking at the debian configuration, you need to replace the symbolic link /etc/systemd/system/getty.target.wants/getty@tty1.service , which refers to the universal service file /lib/systemd/system/getty@.service , to a real file (with the same name - getty@tty1.service ). You can copy the contents of the same /lib/systemd/system/getty@.service , and add the above option to the *getty program call.

    Why replace and not immediately fix the file with the universal service /lib/systemd/system/getty@.service ? so that when switching to other virtual terminals (not tty1 ), the *getty program *getty “as before”, and offers a “normal” invitation to enter a login / password.

  • Actually, my problem is this. We have autologin in old projects -> launching X's, and I need to do the same. But in the old builds I did not find (I don’t know where to look?) This autologin. Now I have your way before an example. Thanks for the answer! - Mira Nov.