How To Create A Shell Auto-login Program
What you will need :
Make sure you have gcc installed in your system because you will be
compiling a new login program.
What this will do:
This program will allow you to automate the login to a shell on a
Linux Box.
What this will not do:
This will not allow you to change the user from a “script” file.
1) Install your RH9 with out a GUI
1. login as root and change the directory to /sbin
2. Then type the following command:
1. vi autologin.c // this will start the vi text editor to
write your program in.
4)Write the following code int the editor:
int main(){
execlp(“login”,”login”,”-f”,”root”,0);
}
1. replace “root” with the user name that you want to login with
2. save the file by first hitting the Esc button, and then typing:
1. :wq
3. now we need to compile the program this can be done by typing
the following line at the bash prompt:
1. gcc -o autologin autologin.c
4. now the program is compiled and already resides in the proper
directory. Save the autologin.c file, it you need to change the
user, you will need to re-compile the program again with the
users name changed to the new one.
5. now open up inittab this is in the /etc directory. Scroll down
till you see:
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
1. and change the line 1:2345:respawn:/sbin/mingetty tty1
..... to
2. 1:2345:respawn:/sbin/agetty -n -l /sbin/autologin 38400
tty1
1. now save the file and reboot the computer with the command:
1. shutdown -r now
2. if every thing went right you now should have a shell without
needing to login.
If you find problems with this script you can send me an email at
support@epromusa.com
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sun Jun 27 19:47:22 2004
This archive was generated by hypermail 2.1.8 : Sun Jun 27 2004 - 19:47:22 AKDT