Operating System - HP-UX
1753768 Members
5212 Online
108799 Solutions
New Discussion юеВ

Launch the web browser when user telnet into the host

 
yc_2
Regular Advisor

Launch the web browser when user telnet into the host

Hi,

Is it possible to write a script or program to launch a web browser with the specify url when a user telnet into a host.

I'm trying to prevent user to telnet to the host for security reason. User can only change their password through the url.


Thanks in advance,
YC
8 REPLIES 8
Steven Sim Kok Leong
Honored Contributor

Re: Launch the web browser when user telnet into the host

Hi,

You may wish to use the following as a template:

In the user .profile (if sh/bash/ksh),
===============================================
#!/sbin/sh
trap "" 1 2 3
lynx http://a.b.c.d/cgi-bin/acctmgt.cgi #replace with the appropriate URL
trap 1 2 3
logout
===============================================

This will launch the lynx text-based web-browser with the URL specified. Note however that you have to disable lynxexec to prevent the user from exiting to shell from lynx.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Philip Chan_1
Respected Contributor

Re: Launch the web browser when user telnet into the host

People can still escape to shell from within Lynx by pressing "!", after that they can still do whatever they want.

If your purpose is to limit your user's telnet functionality for changing password only, why not just replace their login shell field (last field in the /etc/passwd file) to "/sbin/passwd"?

~Philip
Steven Sim Kok Leong
Honored Contributor

Re: Launch the web browser when user telnet into the host

Hi,

You can disallow shell escapes (ie. use of the ! exclamation mark), lynxexec or lynxprog G)oto's in lynx by running lynx with the options "-restrictions=shell"

ie. lynx -restrictions=shell http://a.b.c.d/cgi-bin/acctmgt.cgi

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
yc_2
Regular Advisor

Re: Launch the web browser when user telnet into the host

Hi,

Please advise where I can get the lynx and how to configure lynxexec ?


Rgds,
YC


Steven Sim Kok Leong
Honored Contributor

Re: Launch the web browser when user telnet into the host

Hi,

You can get lynx from:

http://hpux.cs.utah.edu/hppd/hpux/Networking/WWW/lynx-2.8.3/

You perform the restriction as a command-line option to lynx as indicated in my previous thread.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com

yc_2
Regular Advisor

Re: Launch the web browser when user telnet into the host

Hi,

I have installed lynx but when I got error messages when I run it as follows:

lynx https://


error messages:
Alert!: This client does not contain support for HTTPS URLs.


Alert!: This client does not contain support for HTTPS URLs.

lynx: Can't access startfile https://chpwd.tp.edu.sg/

Should there be any modification required over the WEB page ?


Rgds,
YC
Steven Sim Kok Leong
Honored Contributor

Re: Launch the web browser when user telnet into the host

Hi,

lynx does not support SSL access.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Steven Sim Kok Leong
Honored Contributor

Re: Launch the web browser when user telnet into the host

Hi,

Lynx itself does not support SSL. However, you can compile lynx with SSLeay to provide SSL support.

The following URL shows the steps required in the compilation process:

http://www.ocf.berkeley.edu/~jeffwong/lynxstuff/SSL/index.html

Hope this helps. Regards.
Brainbench MVP for Unix Admin
http://www.brainbench.com