Operating System - HP-UX
1834936 Members
2330 Online
110071 Solutions
New Discussion

Force users to log in as named users

 
SOLVED
Go to solution
Angela Swyers_1
Frequent Advisor

Force users to log in as named users

I want to force my users to log in as named users instead of using generic accounts. We need to have account like 'oracle' that you need to be logged in as to run certain procedures, but I want to force them to use the 'su' command so there is an audit. How do I do this? This is not a trusted system.
2 REPLIES 2
Wilfred Chau_1
Respected Contributor

Re: Force users to log in as named users

check $(who -Rm |awk '{print $1}') against the generic account name like oracle.

So if the output for the above is oracle, then exit shell.
Muthukumar_5
Honored Contributor
Solution

Re: Force users to log in as named users

You can make this with /etc/profile to check the $USER or $LOGNAME to match with generic accounts as like oracle.

if [[ $USER = "oracle" ]]
then
echo "Don't login as generic account"
sleep 1
exit 1
fi

You can use arrays to manipulate multiple generic accounts.

hth.

Easy to suggest when don't know about the problem!