[SunHELP] Permissions on /usr/lib/rsh

Chris Pinnock cjep at fawlty.net
Wed Dec 11 01:14:48 CST 2002


On Tue, Dec 10, 2002 at 03:51:05PM -0600, Chris Hall wrote:
>    Is this normal behavior ? 
> 
> # echo $SHELL
> /sbin/sh
> # uname -a
> SunOS host0.mydomain.com 5.8 Generic_108528-13 sun4u sparc SUNW,UltraSPARC-IIi-Engine
> # hostname
> host0.mydomain.com
> # ls -al /usr/lib/rsh
> -r-xr-xr-x   4 root     root       95316 Mar 12  2002 /usr/lib/rsh
> # chmod 000 /usr/lib/rsh
> # ls -al /usr/lib/rsh
> ----------   4 root     root       95316 Mar 12  2002 /usr/lib/rsh
> # clear
> /bin/clear: Permission denied.
> # hostname
> /bin/hostname: Permission denied.
> # /usr/bin/bash
> bash-2.03# hostname
> bash: /usr/bin/hostname: Permission denied
> bash-2.03# clear
> bash: /usr/bin/clear: Permission denied

It is the correct behaviour. As soon as you change the permissions on 
/usr/lib/rsh, you do so on /usr/bin/sh (it is the same file). 
Hostname and clear are sh shell scripts, so will no longer run.
machine% file /bin/hostname 
/bin/hostname:  executable /usr/bin/sh script
machine% ls -la /usr/bin/sh
----------   4 root     root       82624 Nov 21 23:13 /usr/bin/sh
machine% sudo chmod 555 /usr/lib/rsh 
machine% ls -la /usr/bin/sh
-r-xr-xr-x   4 root     root       82624 Nov 21 23:13 /usr/bin/sh

best wishes,
Chris



More information about the SunHELP mailing list