Summary An su and prompt question

From: Kathy Ange <kathyange_at_yahoo.com>
Date: Tue Aug 13 2002 - 13:46:31 EDT
I want to say Thanks you to everyone who responded.  

Larry Snyder" <larrys@lexis-nexis.com>
Doug Winter" <dwinter@icpeurope.net>
Markham, Richard" <RMarkham@hafeleamericas.com>
Alex Stade" <alex@trdlnk.com>
Harrington, David B (Contractor)"
<David.Harrington@dscr.dla.mil
Bill Voight" <BVOIGHT@fcc.gov>
ed.rolison@itc.alstom.com 
Johan Hartzenberg" <jhartzen@csc.com
Hichael Morton" <mh1272@yahoo.com>
Doug Floer" <dfloer@topsoft.ca>
Thomas M. Payerle" <payerle@physics.umd.edu
Patrick O'Reilly" <patrick.oreilly@uni.edu>
david.markowitz@sspsolutions.com 
Gavin McDonald" <Gavin.McDonald@telus.com

I simply moved the PS1 definition from my
$HOME/.kprofile to either the $HOME/.profile or to
/etc/profile, and it worked.  I don't understand why
it didn't work in my korn shell script (names
.kprofile)  but I am happy.  

foobar: kange: $su
Password: 
# id
uid=0(root) gid=1(other)
# 

Larry suggested Can one of the alternate prompt
strings (PS3) do this?
I have tried and can't seem to make this work.  It
would be neat if I could get PS3 to work, so it would
display    foobar: root: #.  But at least I have
something.  Here is what I tried 
PS1="`uname -n`: $LOGNAME: "$
PS3="`uname -n`: root: "#
export PS1 PS3

To all that indicated that giving out root access to
users that don't know unix is scary I have to agree. 
The person is the who installs Oracle, and I don't
have a choice in that matter.



++++++++++++++++ Original Question
++++++++++++++++++++++++++++++++++++

I have received about 10 responses and I guess I
wasn't clear about my situation.  I want to use the su
command not the su - command.  I don't want to change
the user environment, I don't want my directory to
change, just the authority to change.  The su command
is working with the exception of the prompt
automatically changing to a #.  Also I forgot to
mention that if I removed the setting for PS1 in the
.kprofile then I receive the $ prior to a su command
and it changes to a # after the su command.  The thing
is my user want to see the node mane and the userid
name on the prompt.  So the idea situation is a prompt
that looks like this foobar: kange $ before the su
command and foobar: root # after the su command. 
However I would be happy  if it just changed to a
plain # after the su command.  This would let the
users know it worked, which it does they just think it
didn't.

What files does the su command use or read.  If I knew
that maybe the answer would be apparent.  I have read
the man page, and other documents and also the Sun
Managers archives, but haven't discovered any help
yet.

My question is how can I make my prompt change when I
su (It will change if I su - root, as it executes the
.profile)  The problem is with Solaris 2.8 their isn't
a change so the user thought that su didn't work.  For
that reason Solaris 2.6 is a bit better.  Any suggests
would be appreciated.

I have two Operating Systems, one is 2.6 and the other
2.8
In both systems I use korn shell and in .profile I
have the following
ENV=.kprofile
export ENV

Then in the .kprofile I have 
PS1="`uname -n`: $LOGNAME: "$
export PS1 

With Solaris 2.6
foobar:kange: $id
uid=1004(kange) gid=10(staff)

foobar:kange: $pwd
/export/home/kange

foobar:kange: $su 
Password: 

# id
uid=0(root) gid=1(other)

# pwd
/export/home/kange
#


With Solaris 2.8

foobar2: kange: $id     
uid=1001(kange) gid=10(staff)

foobar2: kange: $pwd
/export/home/kange

foobar2: kange: $su     
Password: 

foobar2: kange: $id
uid=0(root) gid=1(other)

foobar2: kange: $pwd
/export/home/kange
foobar2: kange: $


=====
Kathy Ange
Virginia Department of Agriculture & Consumer Services
Information Systems
(804) 786-1340 Voice Mail
(804) 786-2110 FAX
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Tue Aug 13 13:49:35 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:52 EST