Loading
View RSS Feed

Goldsonam's Blog

How To Implement Authentication Program In Shell Script?

Rating: 5 votes, 3.40 average.
This program takes a user name from the user and checks if the user is authentic.If so,it checks if he has logged on to the system.
If the user is logged in,the show time of login.

Code:
Code:
echo "Enter user name"
read a
grep $a  /etc/passwd > aa.txt
if [ -s aa.txt ]
   then
       echo "Authentic User"

who>bb
grep $a bb >cc.txt
if [ -s cc.txt ]
   then
echo " The user is logged in"

echo "Time of login :"
who | cut -d "-" -f3 | cut -d " " -f2
fi
else
echo "The user is not logged in"
fi

Submit "How To Implement Authentication Program In Shell Script?" to Digg Submit "How To Implement Authentication Program In Shell Script?" to del.icio.us Submit "How To Implement Authentication Program In Shell Script?" to StumbleUpon Submit "How To Implement Authentication Program In Shell Script?" to Google

Updated 03-03-2011 at 06:38 PM by Harsh

Tags: shell script
Categories
Unix

Comments




Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.