Operating System - HP-UX
1834419 Members
2328 Online
110067 Solutions
New Discussion

Re: ssh/telnet connection message

 
SOLVED
Go to solution
Xavi Segura_1
Frequent Advisor

ssh/telnet connection message

Hi,

I've installed ssh in my hpux box 11i and I disabled the telnet connection in the inetd.sec, all run ok, but I want to show a message when somobody try to connect via telnet like:
"telnet connections are not allowed, use SSH"

Is possible to configure it??

Thansk and sorry for my poor english
8 REPLIES 8
Muthukumar_5
Honored Contributor

Re: ssh/telnet connection message

If you are using /var/adm/inetd.sec file then you are able to show the message like this. You can try like,


Edit /etc/profile,

ps | grep -q 'telnet'
if [[ ${?} -eq 0 ]]
then
echo "telnet connections are not allowed, use SSH"
sleep 3
exit 1
fi

Save the file and try. IT will give you this option.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: ssh/telnet connection message

Hello,

You can do it via /etc/profile or .profile..

-Arun

"A ship in the harbor is safe, but that is not what ships are built for"
Xavi Segura_1
Frequent Advisor

Re: ssh/telnet connection message

thanks for your reply, but this method show the message after the user type the user/password and refussed the connection.

I want to show the messageand refussed the connection before the user type the user/password.

Thanks for your reply again.
Arunvijai_4
Honored Contributor

Re: ssh/telnet connection message

Hello,

You can try /etc/issue /etc/banner , putting the message ..

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=503331


-Arun

P.S Remember to assign poinits.
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: ssh/telnet connection message

I hope when you disable telnet connection then /etc/banner or /etc/issue will not work to the user. May be you can try with tcpwrapper to block telnet based connection and to show the information before prompting for Login / Password.

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: ssh/telnet connection message

TCPWRAPPER is available as,

http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=TCPWRAP

It is free more. You can try with that.

--
Muthu
Easy to suggest when don't know about the problem!
Xavi Segura_1
Frequent Advisor

Re: ssh/telnet connection message

hi,

With /etc/issue or /etc/banner can modify the telnet message, but I can't refuse the connection and show the message, before the system show the login prompt.

I need this:

When user try to connect via telnet to my server, the system doesn't show a login prompt, only show a customized message and refuse the connection.

Thanks a lot.
Jean-Yves Picard
Trusted Contributor
Solution

Re: ssh/telnet connection message

hello,

just a tought,
how about replacing

telnet stream tcp nowait root /usr/lbin/telnetd telnetd

in inetd.conf by

telnet stream tcp nowait root /usr/bin/echo echo telnet session are not allowed please use ssh

(all in one line of course)

Jean-Yves Picard