[Edit] The audio bug has been fixed, and works fine on my system.[/Edit]

[Edit2] I've fixed this post so that it works with either the bash or tcsh shell.[/Edit]

[Edit3] I replaced the original post with a much simpler, and better method to do the same. The current post reflects some suggestions from posters below. [/edit3]

If you're the only person who uses your computer, you might want to set it up to start consoles with you automatically logged in at boot up. Additionally, you might also want to start X as your user after boot. This post tells you how to do this (without having to install kdm / gdm).

Note: After using this for a long time on my home computer, I now do the same on my laptop. I figure if someone has physical access to my laptop, he'll just take it away, instead of trying to login in and hack my passwords. Any sensitive information on my laptop I keep encrypted (using encfs). All network services are appropriately firewalled and secured. However a user with *physical* access to the computer never requires a password to login at boot time, or become root via su or sudo.

Instructions to do this are below. Use it only if you know that only trusted will have physical access to the computer.

Password-less Console logins
The follwing will make the virtual consoles at boot time password-less (i.e. will be the login shell of your user, without requiring you to authenticate it):

First create the file /root/bin/autologin, and put the following in it:

This starts up one console on vt2 where the user (specified in /root/bin/autologin) is automatically logged in. If you'd like more than one console automatically logged in, repeat the above replacement for lines c3 -- c6 as desired. (Don't forget to change 'np2' and 'tty2' to 'np3' and 'tty3' etc.).

Note Once you logout of the console, it will restart (passwordless ofcourse)! If you want a 'dead console' once you logout, then replace the respawn with once above. If you want anything fancier, you need to write a script.

Passwordless X logins (without kdm / gdm)
Display managers like gdm and kdm have a feature that enables you to log in a user automatically. However if you think gdm or kdm take up too much memory (especially if you want to use a twm / openbox / fluxbox / fvwm / lightweight session) you can avoid running a display manager as follows:

/usr/X11R6/bin/startx: line 111: xauth: command not found
/usr/X11R6/bin/startx: line 112: xauth: command not found
/usr/X11R6/bin/startx: line 111: xauth: command not found
/usr/X11R6/bin/startx: line 112: xauth: command not found
/usr/X11R6/bin/startx: line 150: xinit: command not found
/usr/X11R6/bin/startx: line 1: xauth: command not found

While this is insteresting, it seems the console will always belong to gautam, namely you can't exit and login as a different user at that console.

If you want to log in as a different user, try su - <username>. The primary purpose for this post was for people (like me) who essentially have only one user using their machine. So if you have multiple users who use your machine, you probably won't want to do this anyway ...

If you *really* want to have the 'regular' login screen apear after you're done, replace the command with a script which first runs openvt -e ..., and then runs agetty after it. You can use fgconsole to get the number of the console.

/usr/X11R6/bin/startx: line 111: xauth: command not found
/usr/X11R6/bin/startx: line 112: xauth: command not found
/usr/X11R6/bin/startx: line 111: xauth: command not found
/usr/X11R6/bin/startx: line 112: xauth: command not found
/usr/X11R6/bin/startx: line 150: xinit: command not found
/usr/X11R6/bin/startx: line 1: xauth: command not found

That's strange. It's been working fine for me for a *while*. It might be because the path's are not set right? Does it work if you replace the 'startx' with a shell script which starts X?

[Edit]I figured out why it doesn't work for you. My default shell is tcsh. It reads the environment files by default. Bash doesn't do it unless you pass a -l. I've edited the post above to reflect this.

It seems there's some problem here, after startx, I can't play cd, dvd anymore. If I chage back to agetty and relogin, everything works fine again

I have the same problem. It is because of the permisions of the mixer / sound files in the /dev directory.

When you login the conventional way, devfsd has an event where it gives you all the permissions. If you don't login (i.e. use openvt), then devfsd does not automatically give you the permissions. I've been trying to figure out how to configure devfsd to give permissions on a particular event etc, but the man page confuses me! Hopefully I'll have better luck later.

If I figure it out, I'll post it. The not so nice temp workaround is to manually change the apropriate permissions

I guess I haven't updated this in a while. Autologin consoles can be done using agetty itself. All you have to do is replace the login program (using -l) with a shell script that does "login -f <username>".

Starting X should probably be done using local.start too. I'll edit my original post to show this.

The reason I ddn't use nanodust's method is because it results in tty1 "dead" (with just error messages from startx), and another tty used by X. Plus when I tried mingetty, I got some wierd message about "ioctl() failed, job control will be disabled" every time tcsh ran. Thus the agetty solution...

I have a machine with LXDE, and with this script I can login immediately without problems.
I only have a little glitch: X starts in English and not in the right tongue. However, if I close the graphic session and then start X again from the auto-logged-in user terminal, everything is in the expected language.
The LANG variable is correctly configured, and I see no differences in the output of the env command inside the English and Italian sessions user xterms.

Does anybody know where I am wrong?

Thanks in advance for any hints.
Best regards._________________ANTONIO: How every fool can play upon the world! I think the best grace of wit will shortly turn into silence, and discourse grow commendable in none only but parrots...

I want to be able to login and startx, and to be sure than all my customizations in ~/.bash_profile and ~/.bashrc are enforced. I want it to be so less intrusive than possible and I want the user login on tty2.

gi1242 wrote:

The follwing will make the virtual consoles at boot time password-less (i.e. will be the login shell of your user, without requiring you to authenticate it):

First create the file /root/bin/autologin, and put the following in it:

The commented out code will let you to choose if you want to run startx or login into the console._________________[[[ To any NSA and FBI agents reading that text: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]