Operating System - HP-UX
1830250 Members
2778 Online
110000 Solutions
New Discussion

Setting telnet allow configuration

 
zap_2
Advisor

Setting telnet allow configuration

Hi unix gurus, how to setting telnet configuration so only certain ip that listed in ip allowed list can using telnet service.
Tia.
10 REPLIES 10
Muthukumar_5
Honored Contributor

Re: Setting telnet allow configuration

Hai,

Use inetd.sec file to do this. For example,

--/etc/inetd.sec--
telnetd allow

refer inetd.sec man page more
Easy to suggest when don't know about the problem!
T G Manikandan
Honored Contributor

Re: Setting telnet allow configuration

Make the appropriate entries in /var/adm/inetd.sec file.

check the man pages of inetd.sec..
zap_2
Advisor

Re: Setting telnet allow configuration

On my server, file /var/adm/inetd.sec doesn't exist.
Keith Bryson
Honored Contributor

Re: Setting telnet allow configuration

Hi there

Try copying the example from /usr/newconfig/var/adm/inetd.sec.

If you are feeling adventurous, you may also try TCP wrappers - downloadable from software.hp.com.

All the best - Keith
Arse-cover at all costs
Hoang Minh Tuan
Regular Advisor

Re: Setting telnet allow configuration

hi,

If it does not exist, make a new file by editting #vi /var/adm/inetd.sec then following the format: service allow|deny ip-address
i.e: telnet deny 192.168.1.1

HMT
Bus wait at bus station, Work wait at my work station
Hoang Chi Cong_1
Honored Contributor

Re: Setting telnet allow configuration

Hi Tia

What is your OS's platform?
For HP-UX, you can modify the /var/adm/inetd.sec file to allow with IP can telnet to your server.
For SUN or AIX, it is difference.

Regard,
HoangChiCong
Looking for a special chance.......
zap_2
Advisor

Re: Setting telnet allow configuration

Need restart the server after I add certain line in /var/adm/inetd.sec ?
Robert-Jan Goossens
Honored Contributor

Re: Setting telnet allow configuration

No, just use the 'inetd -c' command to re-initialize the inet daemon.

Robert-Jan
Hoang Chi Cong_1
Honored Contributor

Re: Setting telnet allow configuration

Hi

I post the inetd.sec file, you can download it.
The right permission is:

-r-------- 1 root sys

After modify you just restart the inet daemon:
#inetd -c

Goodluck
HoangChiCong
Looking for a special chance.......
Jack C. Mahaffey
Super Advisor

Re: Setting telnet allow configuration

This is what I've done.

Step one - Create a file named /etc/telnet.allow. Include logins that require telnet access.

Step two - Add the following to /etc/profile:
--------------------------------------


#
# Configure telnet access - root can always telnet to the server
#
if [ -f /etc/telnet.allow ] ; then
user_id=${LOGNAME}
telnetused=`/usr/bin/ps -f | grep "[t]elnetd" | grep -v "grep" | wc -l`
if [ -s /etc/telnet.allow ] ; then
userallowcount=`grep "^$user_id$" /etc/telnet.allow | wc -l`
else
userallowcount=0
fi
if [ $telnetused -gt 0 -a $userallowcount -eq 0 -a "Xroot" != "X${LOGNAME}" ] ; then
DATEE=`/usr/bin/date +%Y%m%d`
TIMEE=`/usr/bin/date +%H%M%S`
NDNAME=`/usr/bin/uname -n`
BASENM=`/usr/bin/basename $0`
echo "ERMS1311: Error - Telnet access is not allowed... Terminating"
if [ -f /usr/bin/logger ] ; then

/usr/bin/logger -t "login" "ERMS1311: Error - Telnet access for ${LOGNAME} is not allowed... Te
rminating..."
fi
echo "ERMS1001: Error - YOU DO NOT HAVE TELNET ACCESS TO THIS SERVER"
echo "SESSION TERMINATING IN 10 SECONDS"
echo "${DATEE} : ${TIMEE} : ${NDNAME} : ${user_id} : ERMS1311 Telnet access not allo
wed" >> /var/adm/security/telnet_deny.log
sleep 10
exit 99
fi
fi


--------------------------------------

It might not be pretty but it works. Failures are logged to /var/adm/security/telnet_deny.log