* preserving/re-creating alias(s) when using su
@ 1998-12-15 5:00 Sandlin,William
1998-12-15 5:00 ` Pierre Asselin
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Sandlin,William @ 1998-12-15 5:00 UTC (permalink / raw)
I'm using the Korn shell under Unix 4.0 and have a number of aliases
being defined in .profile. The application I am working with requires
that I perform some management functions as the root. My problem is
that I loose all of my aliases when I su (the documentation says this
is supposed to happen).
How can these be preserved?? If they cannot be preserved, is there a
profile that is executed when I su that I could also have the aliases
defined in.
Thanks in Advance
William Sandlin
Georgia Physician Services
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: preserving/re-creating alias(s) when using su
1998-12-15 5:00 preserving/re-creating alias(s) when using su Sandlin,William
@ 1998-12-15 5:00 ` Pierre Asselin
1998-12-15 5:00 ` Nikola Milutinovic
` (3 more replies)
1998-12-16 5:00 ` Bob Koehler
1998-12-16 5:00 ` Charles M Richmond
2 siblings, 4 replies; 8+ messages in thread
From: Pierre Asselin @ 1998-12-15 5:00 UTC (permalink / raw)
Sandlin,William wrote:
>
> I'm using the Korn shell under Unix 4.0 and have a number of aliases
> being defined in .profile. The application I am working with requires
> that I perform some management functions as the root. My problem is
> that I loose all of my aliases when I su (the documentation says this
> is supposed to happen).
>
> How can these be preserved?? If they cannot be preserved, is there a
> profile that is executed when I su that I could also have the aliases
> defined in.
You could create a secondary root account, with a uid of zero
but with a different login, password, home directory etc. than
root. You can then customize that account identically to yours.
When the need arises, you just "su -" to that account and change
directory back to where you were. You could even make the account's
home directory be the normal maintenance directory for the
application (if there is such a thing).
Whatever you do, DON'T CUSTOMIZE ROOT. root has to be able to
login in single-user mode even if the network is down, or /usr
is corrupted, etc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: preserving/re-creating alias(s) when using su
1998-12-15 5:00 ` Pierre Asselin
@ 1998-12-15 5:00 ` Nikola Milutinovic
1998-12-18 5:00 ` Mark@Ace
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Nikola Milutinovic @ 1998-12-15 5:00 UTC (permalink / raw)
Pierre Asselin wrote:
>
> Whatever you do, DON'T CUSTOMIZE ROOT. root has to be able to
> login in single-user mode even if the network is down, or /usr
> is corrupted, etc.
Just FYI, when things go bad and you have to log into single user mode,
all customizations are IGNORED. I usually setup root with ZSh, but when
I log into SU, I'm in /bin/sh.
Nix.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: preserving/re-creating alias(s) when using su
1998-12-15 5:00 preserving/re-creating alias(s) when using su Sandlin,William
1998-12-15 5:00 ` Pierre Asselin
@ 1998-12-16 5:00 ` Bob Koehler
1998-12-16 5:00 ` Charles M Richmond
2 siblings, 0 replies; 8+ messages in thread
From: Bob Koehler @ 1998-12-16 5:00 UTC (permalink / raw)
In article <3676689a.410514727@news.mindspring.com>, gps_is@mindspring.com (Sandlin,William) writes:
>How can these be preserved?? If they cannot be preserved, is there a
>profile that is executed when I su that I could also have the aliases
>defined in.
>
IF you're positive that you have a .profile which is SAFE to run from
root, you can just use the ksh "." command after you su.
----------------------------------------------------------------------
Bob Koehler | Computer Sciences Corporation
Hubble Space Telescope Payload | Federal Sector, Civil Group
Flight Software Team | please remove ".aspm" when replying
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: preserving/re-creating alias(s) when using su
1998-12-15 5:00 preserving/re-creating alias(s) when using su Sandlin,William
1998-12-15 5:00 ` Pierre Asselin
1998-12-16 5:00 ` Bob Koehler
@ 1998-12-16 5:00 ` Charles M Richmond
2 siblings, 0 replies; 8+ messages in thread
From: Charles M Richmond @ 1998-12-16 5:00 UTC (permalink / raw)
"Sandlin,William" wrote:
>
> I'm using the Korn shell under Unix 4.0 and have a number of aliases
> being defined in .profile. The application I am working with requires
> that I perform some management functions as the root. My problem is
> that I loose all of my aliases when I su (the documentation says this
> is supposed to happen).
>
> How can these be preserved?? If they cannot be preserved, is there a
> profile that is executed when I su that I could also have the aliases
> defined in.
>
Try putting your aliases, environment variables, etc, in ~/.kshrc and
in your .profile, put "ENV=$USER/.kshrc; export ENV"
--
***********************************************************************
* Charles Richmond Integrated International Systems Corporation *
* cmr@iisc.com cmr@koibito.iisc.com cmr@shore.net *
* UNIX Internals, I18N, L10N, X, Realtime Imaging, and Custom S/W *
* One Longfellow Place Suite 3309 , Boston , Ma. USA 02114-2431 *
* (617) 723 7695 (617) 367 3151 FAX (617) 723 6861 *
***********************************************************************
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: preserving/re-creating alias(s) when using su
1998-12-15 5:00 ` Pierre Asselin
1998-12-15 5:00 ` Nikola Milutinovic
1998-12-18 5:00 ` Mark@Ace
@ 1998-12-18 5:00 ` Mark@Ace
1998-12-18 5:00 ` Mark@Ace
3 siblings, 0 replies; 8+ messages in thread
From: Mark@Ace @ 1998-12-18 5:00 UTC (permalink / raw)
To: Pierre Asselin
WRONG WRONG!!
No matter what you do the shell run in single user mode is /sbin/sh and is
exec'd explicitly from /sbin/init This allows
even for /etc/passwd to be corrupt , just one of the reasons you might be
booted in single user mode in the first place.
When you su , you start a new shell so your alias are left behind you need
to re source your .profile or set them in roots profile and su -
which ever takes you fancy
Cheers
Mark :)
Pierre Asselin wrote:
> Sandlin,William wrote:
>
>
> Whatever you do, DON'T CUSTOMIZE ROOT. root has to be able to
> login in single-user mode even if the network is down, or /usr
> is corrupted, etc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: preserving/re-creating alias(s) when using su
1998-12-15 5:00 ` Pierre Asselin
1998-12-15 5:00 ` Nikola Milutinovic
@ 1998-12-18 5:00 ` Mark@Ace
1998-12-18 5:00 ` Mark@Ace
1998-12-18 5:00 ` Mark@Ace
3 siblings, 0 replies; 8+ messages in thread
From: Mark@Ace @ 1998-12-18 5:00 UTC (permalink / raw)
To: Pierre Asselin
WRONG WRONG!!
No matter what you do the shell run in single user mode is /sbin/sh and is
exec'd explicitly from /sbin/init This allows
even for /etc/passwd to be corrupt , just one of the reasons you might be
booted in single user mode in the first place.
When you su , you start a new shell so your alias are left behind you need
to re source your .profile or set them in roots profile and su -
which ever takes you fancy
Cheers
Mark :)
Pierre Asselin wrote:
> Sandlin,William wrote:
>
>
> Whatever you do, DON'T CUSTOMIZE ROOT. root has to be able to
> login in single-user mode even if the network is down, or /usr
> is corrupted, etc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: preserving/re-creating alias(s) when using su
1998-12-15 5:00 ` Pierre Asselin
` (2 preceding siblings ...)
1998-12-18 5:00 ` Mark@Ace
@ 1998-12-18 5:00 ` Mark@Ace
3 siblings, 0 replies; 8+ messages in thread
From: Mark@Ace @ 1998-12-18 5:00 UTC (permalink / raw)
To: Pierre Asselin
WRONG WRONG!!
No matter what you do the shell run in single user mode is /sbin/sh and is
exec'd explicitly from /sbin/init This allows
even for /etc/passwd to be corrupt , just one of the reasons you might be
booted in single user mode in the first place.
When you su , you start a new shell so your alias are left behind you need
to re source your .profile or set them in roots profile and su -
which ever takes you fancy
Cheers
Mark :)
Pierre Asselin wrote:
> Sandlin,William wrote:
>
>
> Whatever you do, DON'T CUSTOMIZE ROOT. root has to be able to
> login in single-user mode even if the network is down, or /usr
> is corrupted, etc.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1998-12-18 5:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-12-15 5:00 preserving/re-creating alias(s) when using su Sandlin,William
1998-12-15 5:00 ` Pierre Asselin
1998-12-15 5:00 ` Nikola Milutinovic
1998-12-18 5:00 ` Mark@Ace
1998-12-18 5:00 ` Mark@Ace
1998-12-18 5:00 ` Mark@Ace
1998-12-16 5:00 ` Bob Koehler
1998-12-16 5:00 ` Charles M Richmond
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox