[comp.unix.questions] login shell == ../vi

han@cgl.ucsf.edu (Charles S. Han%Langridge) (06/18/87)

Reply-To:

Distribution:

Organization:


A question:

	change your login shell entry in the password file from /bin/csh (or 
	whatever) to ../vi.

	is there any (non-super user) way to change your login shell back to
	anything functional?

tgr@picuxa.UUCP (06/22/87)

In article <10249@cgl.ucsf.EDU>, han@cgl.ucsf.edu (Charles S. Han%Langridge) writes:
> 	is there any (non-super user) way to change your login shell back to
> 	anything functional?

Not really; you must have root/su/sysadmin privileges to write to the
password file.

Under AT&T UNIX (tm) SVR3 (for 3B2), their is a menu-driven system
administration tool which will allow you to change a user's login shell
(sysadm chgshell under usermgmt.moduser).


-- 
 Tom Gillespie   ( ..!whuts!picuxa!tgr)   | "We're holding Elvis Presley's
 AT&T/EDS Product Integration Center	  |  brain hostage on Planet 
 299 Jefferson Rd.                        |  Zort...SURRENDER NOW"
 Parsippany, NJ 07054  (201) 952-1178	  |  		B. Breathed

twb@hoqax.UUCP (BEATTIE) (06/23/87)

In article <196@picuxa.UUCP>, tgr@picuxa.UUCP (Thomas Gillespie) writes:
> In article <10249@cgl.ucsf.EDU>, han@cgl.ucsf.edu (Charles S. Han%Langridge) writes:
> > 	is there any (non-super user) way to change your login shell back to
> > 	anything functional?
> 
> Not really; you must have root/su/sysadmin privileges to write to the
> password file.

I use:	chsh(1) - Change default login shell.
Tom.

todd@uhccux.UUCP (The Perplexed Wiz) (06/26/87)

In article <196@picuxa.UUCP> tgr@picuxa.UUCP (Thomas Gillespie) writes:
>In article <10249@cgl.ucsf.EDU>, han@cgl.ucsf.edu (Charles S. Han%Langridge) writes:
>>is there any (non-super user) way to change your login shell back to
>>anything functional?
>Not really; you must have root/su/sysadmin privileges to write to the
>password file.

There is a command called 'chsh' (change shell) in BSD versions of UNIX
that allows non-super users to change their login shell to either
/bin/csh or /bin/sh (and perhaps /usr/new/csh).  However, some system
administrators deny access to chsh to prevent users from accidentally
changing their login shell (if you don't tell chsh what you want, it
changes the login shell to /bin/sh).  If you are on a BSD system, check
and see if you have /usr/ucb/chsh on it....todd

-- 
Todd Ogasawara, U. of Hawaii Center for Teaching Excellence
UUCP:		{ihnp4,seismo,ucbvax,dcdwest}!sdcsvax!nosc!uhccux!todd
ARPA:		uhccux!todd@nosc.MIL
INTERNET:	todd@uhccux.UHCC.HAWAII.EDU

arosen@eagle.CS.ULowell.Edu (Andy Rosen) (06/26/87)

In article <629@uhccux.UUCP> todd@uhccux.UUCP (The Perplexed Wiz) writes:
>In article <196@picuxa.UUCP> tgr@picuxa.UUCP (Thomas Gillespie) writes:
>>In article <10249@cgl.ucsf.EDU>, han@cgl.ucsf.edu (Charles S. Han%Langridge) writes:
>>>is there any (non-super user) way to change your login shell back to
>>>anything functional?
>>Not really; you must have root/su/sysadmin privileges to write to the
>>password file.
>
>There is a command called 'chsh' (change shell) in BSD versions of UNIX
>that allows non-super users to change their login shell to either
>/bin/csh or /bin/sh (and perhaps /usr/new/csh).

chsh exists only in BSD versions.  SysV does not have chsh so you need
super-user access to change someones shell.

>However, some system
>administrators deny access to chsh to prevent users from accidentally
>changing their login shell

The file /etc/shells contains a newline seperated list of permissible
shells for chsh.  If anyone could make their shell whatever they like...

Andy Rosen         | ulowell!arosen | ************* | "I got this guitar and I
ULowell, Box #3031 |                | * RD in '88 * |  learned how to make it
Lowell, Ma 01854   |                | ************* |  talk" -Thunder Road
Andy Rosen         | ulowell!arosen | ************* | "I got this guitar and I
ULowell, Box #3031 |                | * RD in '88 * |  learned how to make it
Lowell, Ma 01854   |                | ************* |  talk" -Thunder Road

randy@chinet.UUCP (Randy Suess) (06/29/87)

In article <1452@ulowell.cs.ulowell.edu> arosen@eagle.cs.ulowell.edu (Andy Rosen) writes:
>
>chsh exists only in BSD versions.  SysV does not have chsh so you need
>super-user access to change someones shell.

	There was a public domain chsh posted to the net a while
ago that works just fine on my 3b2 and Microport UNIX, both SysV.
I can email to any interested.



-- 
that's the biz, sweetheart.....
Randy Suess
..!ihnp4!chinet!randy

root@hobbes.UUCP (John Plocher) (06/30/87)

+---- Andy Rosen writes the following in <1452@ulowell.cs.ulowell.edu> ----
| chsh exists only in BSD versions.  SysV does not have chsh so you need
| super-user access to change someones shell.
| 
| >However, some system
| >administrators deny access to chsh to prevent users from accidentally
| >changing their login shell
| 
| The file /etc/shells contains a newline seperated list of permissible
| shells for chsh.  If anyone could make their shell whatever they like...
+-----

Am I missing something?  Why shouldn't a user be allowed to change her
shell to be anything she wants?  What is the difference between her running
a program from a shell (% /usr/local/emacs foobar) or having the program as
her shell (me::1000:1000:I said ME:/usr/guest:/usr/local/emacs)?

If I as a user change my shell to /bin/echo I will then have to beg root to
change it back to something useful, same as if I changed it it /bin/true or
/usr/ucb/yes.  More work for root, but in the given case (shell == ../vi)
the public domain chsh from mod.sources archives tests to see that the new
shell has an absolute path starting from / and has execute permissions.

If I can't execute a program from a shell because of access restrictions
(ie /usr/adm/accton) then I wouldn't be able to execute it as a login
shell, right?

    John Plocher
-- 
 John Plocher		UUCP: <backbone>!uwvax!uwmacc!hobbes!plocher
==============      Internet: plocher%hobbes.UUCP@uwvax.cs.Wisc.EDU
FidoNet: 121/0	      BITNET: uwvax!uwmacc!hobbes!plocher@psuvax1

richl@penguin.USS.TEK.COM (Rick Lindsley) (07/01/87)

In article <139@hobbes.UUCP> root@hobbes.UUCP (John Plocher) writes:
> Am I missing something?  Why shouldn't a user be allowed to change her
> shell to be anything she wants?  What is the difference between her running
> a program from a shell (% /usr/local/emacs foobar) or having the program as
> her shell (me::1000:1000:I said ME:/usr/guest:/usr/local/emacs)?
> 
> If I as a user change my shell to /bin/echo I will then have to beg root to
> change it back to something useful, same as if I changed it it /bin/true or
> /usr/ucb/yes.  More work for root, but in the given case (shell == ../vi)
> the public domain chsh from mod.sources archives tests to see that the new
> shell has an absolute path starting from / and has execute permissions.

I think you've hit it right there -- more work for root.

Consider a non-professional environment, say a university. Somebody
gets mad because their paper quota has run out, and they can't buy
anymore. So they write a quick program that ignores keyboard generated
signals and change their login shell. Then they log in to as many
terminals as possible, thus locking them up until a root-type person
can do a ps (possibly from the console) and kill them. Oh sure, he can
only lock up maybe 20 terminals before he exceeds his process limit,
but from the point of view of the rest of the computing environment he
has screwed them royally ... Everyone hates him, of course, but what
does he care? He's leaving this stupid school anyway, because school
sucks, and .........

Or the case of the simply naive person from ANY environment (in this
case, on a machine with job control). They make their shell vi. Then
they type ^Z. Ooops. Hung terminal. Find a root person. If it's after
5, you might have to hang it up for the day.

Rick

paulsc@orca.TEK.COM (Paul Scherf) (07/02/87)

In article <46@puffin.USS.TEK.COM> richl@penguin.USS.TEK.COM (Rick Lindsley) writes:
>In article <139@hobbes.UUCP> root@hobbes.UUCP (John Plocher) writes:
>> Am I missing something?  Why shouldn't a user be allowed to change her
>> shell to be anything she wants?  What is the difference between her running
>> a program from a shell (% /usr/local/emacs foobar) or having the program as
>> her shell (me::1000:1000:I said ME:/usr/guest:/usr/local/emacs)?

>Consider a non-professional environment, say a university. Somebody
>gets mad because their paper quota has run out, and they can't buy
>anymore. So they write a quick program that ignores keyboard generated
>signals and change their login shell. Then they log in to as many
>terminals as possible, thus locking them up until a root-type person
>can do a ps (possibly from the console) and kill them. Oh sure, he can
>only lock up maybe 20 terminals before he exceeds his process limit,
>but from the point of view of the rest of the computing environment he
>has screwed them royally ... Everyone hates him, of course, but what
>does he care? He's leaving this stupid school anyway, because school
>sucks, and .........

>Or the case of the simply naive person from ANY environment (in this
>case, on a machine with job control). They make their shell vi. Then
>they type ^Z. Ooops. Hung terminal. Find a root person. If it's after
>5, you might have to hang it up for the day.

My .profile / .cshrc was:

	exec vi program1.c

the last semester I was at school (you know, back when I was
non-professional (-: ).  I figure that works out to the same thing as
changing my shell.  It actually worked out pretty well.  I had to
":!lpr %" to print my file, or ":!cc %" to compile, ... but it really
wasn't so bad.  (I also had to ":n ~/.cshrc" when it was time to start
on program2.c. (-: )  It is also a lot less political (and, evidentally,
a lot less emotional) issue than actually changing your shell.

There were fairly tight time limits on how long one could use a
terminal at one time and the machines were pretty heavily loaded.  I
think using vi as my "shell" helped me use the terminals much more
effectively.

Paul Scherf, Tektronix, Box 1000, MS 61-033, Wilsonville, OR, USA
paulsc@orca.GWD.Tek.COM			tektronix!orca!paulsc

korn@altger.UUCP (07/06/87)

/***** altger:comp.unix.ques / cgl!han /  7:31 pm  Jun 18, 1987*/

A question:

	change your login shell entry in the password file from /bin/csh (or 
	whatever) to ../vi.

	is there any (non-super user) way to change your login shell back to
	anything functional?
/* ---------- */

from vi, set your default shell:         set shell=/bin/sh
get that shell:                          sh
change your login-shell:                 chsh /bin/sh

Questions ? Details ? Feel free to mail me!

--------------------------------------------------------------------
Hans Korneder     UUCP:      ...!seismo!mcvax!unido!altger!korn
                  SNAILMAIL: Gebsattelstr. 32, D-8000 Muenchen 90
                  VOICE:     +49 89 4488373
----snip----snip----snip----snip----snip----snip----snip----snip----
                                 +-------------------------------------+
The opinions above are my own.   | Advertising space for rent !        |
They can be yours too !!         | Send requests to the adress above ! |
Send $57.95 to the adress above. +-------------------------------------+
(Offer void where prohibited by law or good taste)