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.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix