Sunday, 14 October 2012

Practical no-9: Examine the content of the /etc/passwd file.


Practical no-9: Examine the content of the /etc/passwd file.

# vi/etc/passwd
mac1
/bin/sh
mac2  /bin/csh
mac3  /bin/bash

There you can see the full pathnames of the shell for the new users
created

4. # vi/etc/shadow
mac1:!!::
mac2:!!::
mac3:!!::
user2:!!::

This is because you we have not set password for the users mac1,mac2
and mac3

Practical no-10

#!/bin/bash
echo "1. all user list"
echo "2.current user"
echo "3.count logged users"
printf "Enter choice:"read choice
if [$choice==1];
then
Who -h
Fi

if [$choice==2];
then
who am i
fi

if [$choice==3];
then
echo "Total users loged in:"
fi

1. all user list
2. current user
3. count logged user
Enter choice:2
Root

No comments:

Post a Comment