The login Process

The beginning of it all....
A Synopsis of autologin

The first line tells the kernel how to run this program, in this case by letting the bash shell interpret it. The first exec line is a Bourne shell trick that lets a shell script change the source/destination of its standard input, standard output and standard error. We want to set file descriptors 0, 1 and 2 to refer to the terminal device as expected by login (and many other programs) when they run. The cat command displays the system's standard logon message. The shift command shifts the positional parameters to the shell script. Argument $1 is deleted, argument $2 becomes $1, argument $3 becomes $2 and so on. The last line executes the rest of the command line as a program. In this case, the login -f option performs the normal login procedure, with the -f option telling login not to bother with passwords.

Andy Vaught is currently a Ph.D. candidate in computational physics at Arizona State University and has been running Linux since 1.1. He enjoys flying with the Civil Air Patrol as well as skiing. He can be reached at



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thank you

Hannes's picture

The awesomelyness!

Now I am one step closer to creating a Linux-based process control system


Hannes's picture

I forgot to mention that I really appreciate the detailed explanations in the article!


jayanta's picture

hi...i m doing my final year project on remote login in linux using java.
can i use "login" programme for that.
i have found shadowed password in /etc/shadow .
it is encrypted using SHA-512 .Can i encrypt password using SHA-512 and then match with encrypted password in shadow file.

Valued Artical

Anonymous's picture


I have install damnlinux on dishonchip , i donot able find autologin script or command under sbin.



ChrisH's picture

Autologin is a script given by the author of this article:

Listing 1. autologin

exec 0/dev/$1 2>&1
cat /etc/issue
exec $*

I think, that here is a

patsch's picture

I think, that here is a little writing fault:
exec 0/dev/$1 2>&1
cat /etc/issue
exec $*

the line: exec 0/dev/$1 2>&1
should look like this:

exec 0&1

thanx for the great documentation : )

f* it should look like

Patsch's picture

it should look like this:

"exec 0 < / dev / $ 1 2 > & 1"

( whithout the spaces in between... i don't know, why i can't post it like it should look like!!?? )

Wonderful Script

RaviShankar's picture

The Information given in the site was verymuch helpful for my automation. Thanks for the wonderful script.