Unix Shell - Logon script

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2006 > Logon script





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Logon script
nicetom786@yahoo.com

2006-10-25, 1:27 pm

am writing a logon script.
Here are the things I did want to make.
Connect to myself with username and pwd
then connect to a differnt account on the same machine using "su".

I can put this commands in teh automated logon screen ,but I want to
run a logon script after disabling automated logon.
If so ,my questions...
1.command to connect to my machine first with username and pwd to pass
in a script.
2.command to connect to a different user on the same machine with
username and pwd to pass in a script using su.
3.Where shoudl I place this script and I want to execute it everytime I

start a new session.
Here is the script....
This script will connect me to diferent user but it asks me the
password after I get connected.How should I pass the pwd also in the
script/.
I want to make this a automated one .
Pls guide.


#!/bin/ksh
WHO=`who am i | awk '{print $1}'`
print ${WHO}
echo "Do you want to get connected to DIFFERENT USER? (Y/N)"
read yorn
if [ "${yorn}" = "Y" -o "${yorn}" = "y" ]
then
print ${yorn}
su - DIFFERENT_USER
else
echo "You are in the directory "
pwd
fi

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com