The login Process

 in
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 andy@maxwell.la.asu.edu.

______________________

Comments

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!

authentication

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

Hi,

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

Praful

script

ChrisH's picture

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

http://www.linuxjournal.com/articles/lj/0058/3121/3121l1.html

Listing 1. autologin

#!/bin/bash
exec 0/dev/$1 2>&1
cat /etc/issue
shift
exec $*

I think, that here is a

patsch's picture

I think, that here is a little writing fault:
#!/bin/bash
exec 0/dev/$1 2>&1
cat /etc/issue
shift
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

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

Geek Guide
The DevOps Toolbox

Tools and Technologies for Scale and Reliability
by Linux Journal Editor Bill Childers

Get your free copy today

Sponsored by IBM

Webcast
8 Signs You're Beyond Cron

Scheduling Crontabs With an Enterprise Scheduler
On Demand
Moderated by Linux Journal Contributor Mike Diehl

Sign up and watch now

Sponsored by Skybot