SUMMARY: su $USER

From: Chris Bryant <Chris.Bryant_at_DTAG.Com>
Date: Thu, 30 Jan 2003 07:56:42 -0600

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
Received on Thu Jan 30 2003 - 16:00:53 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:44 NZDT