SUMMARY: su $USER

From: Chris Bryant (Chris.Bryant@DTAG.Com)
Date: Thu Jan 30 2003 - 08:56:42 EST


Thanks to Darryl Cook, Dr. Thomas Blinn, and James Sainsbury for their
responses. It was James Sainsbury that came up with the easiest solution.
Basicly his suggestion was to write a C program to execute the script that
would normally be executed in this accounts .profile and place the c
programs path in the shell portion of the accounts /etc/passwd entry. I did
this and now when anyone su, su - , logs in direct, it will not take them to
a command line. The source code is as follows:

 #include<stdio.h>

 main()
 {
         system("/usr/local/bin/script"); /* place script you want to
execute here */
 }

Thanks again,

Chris
-----Original Message-----

Admins,

        I have an account which I have set up on a 5.1 UNIX machine which
when executing the accounts profile ( via a direct login or a su - $USER )
will execute a shell script for them. However, when someone executes a su
$USER from the command line will take them into a shell prompt. Now I am
wanting anyone who uses this account to have to login directly and not have
the functionality of su, however I am not sure how to disable this for one
user. Any ideas? I will summarize.

TIA,

Chris Bryant
Unix Administrator
Dollar Thrifty Automotive Group



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:06 EDT