[techtalk] yet another solaris question ...

Chris J/#6 sixie at nccnet.co.uk
Fri Jul 7 22:56:56 EST 2000


> Hi chix!
> 
> While we're discussing the passwd file, i have a problem.  I didn't
> really know another way to set my PATH automatically other than
> appending it to my shell line in my passwd file, like this:
> 
> jellhead:x:100:1::/export/home/jellhead:/usr/local/bin/tcsh;setenv
> PATH /usr/sbin:/usr/bin:/usr/local/bin:/usr/ccs/bin
> 
> This worked for me in linux in the past, but my Solaris Sparc server
> doesn't like it (i can't log in as jellhead anymore).  Does anyone
> know a good alternative?  I've considered a few other things, but i'm
> a little intimidated by this funky Solaris box ...

Wibble ... not seen this before -- bad practice :)

Okay... you need to modify any of:
	/etc/profile	- Global settings for ksh, sh (and bash?)
	/etc/csh.cshrc	- Global settings for csh, tcsh
	$HOME/.profile	- User settings for ksh, sh
	$HOME/.cshrc	- User settings for csh, tcsh

Now -- as you're using tcsh, take your pick of .cshrc or /etc/cshrc ... the 
line you want to do would be:
	setenv PATH ${PATH}:/new/path/here:/another/new/path/here:/and/so/on

basically, each path is seperated by a colon. The first reference to ${PATH} 
ensures any existing path remains. If you want to set it from scratch, feel 
free to ignore it :)

> 
> # begin horror story
> Last time i made changes to my passwd file on this server, i decided i
> was really, really tired of using sh, so i decided to set my SHELL in
> the passwd file to /usr/local/bin/tcsh.  Unfortunately i mistyped the
> path, and it was after i *saved the file and logged off* and tried to
> log back in using my new settings that i discovered NO ONE HAS ROOT
> ACCESS TO THE THING ANYMORE!!  We had to go over to the rack (this is
> a Sun Netra1) and boot the thing off the CD to fix it.  Luckily the
> sysadmins involved (i'm not the sysadmin, i'm the webmaster) didn't
> give me *too* hard of a time :-)
> # end horror story
> 

One hint -- in general, changing the shell for root is a bad thing...some 
Unixes don't like it, as some tools assume the root shell will be /bin/sh 
(cron is one example). Now, you didn't say which shell you were changing, but 
it sounds like the root shell.

If you want to use another shell as root, either start it manually when you 
log in, or in /.profile get that to start your preferred shell...eg,

	exec /bin/ksh

Using exec will force the shell to replace the currently executing shell in 
userspace, so you don't need to type exit twice to logout :) It leaves 
/etc/passwd alone and is then kinder to fussy apps.

Also place any shells used as login shells in /etc/shells...this ensures 
things like ftpd don't complain. :)

Chris... :)


-- 
@}-,'--------------------------------------------------  Chris Johnson --'-{@
    / "(it is) crucial that we learn the difference / sixie at nccnet.co.uk  \
   / between Sex and Gender. Therein lies the key  /                       \ 
  / to our freedom" -- LB                         / www.nccnet.co.uk/~sixie \ 







More information about the Techtalk mailing list