Disabling r services on Solaris

From Brandonhutchinson.com

Jump to: navigation, search

Note: Even if inetd is not running, it is a good idea to comment out r services in inetd.conf in case inetd is ever inadvertently started.

Are any r services enabled in inetd.conf?

$ egrep '^shell|^exec|^login' /etc/inet/inetd.conf
shell   stream  tcp     nowait  root    /usr/sbin/in.rshd       in.rshd
shell   stream  tcp6    nowait  root    /usr/sbin/in.rshd       in.rshd
login   stream  tcp6    nowait  root    /usr/sbin/in.rlogind    in.rlogind
exec    stream  tcp     nowait  root    /usr/sbin/in.rexecd     in.rexecd
exec    stream  tcp6    nowait  root    /usr/sbin/in.rexecd     in.rexecd

If so, disable the r services in inetd.conf. The version of perl on this system does not support the -i flag.

# perl -pe 's/^shell/#shell/;s/^login/#login/;s/^exec/#exec/' /etc/inet/inetd.conf > /etc/inet/inetd.conf.new
# mv /etc/inet/inetd.conf.new /etc/inet/inetd.conf
# chmod 444 /etc/inet/inetd.conf
# chown root:sys /etc/inet/inetd.conf

Send inetd a SIGHUP for the changes to take effect.

# pkill -HUP inetd

Links:

Personal tools