Automating lynx prompt enties - Firewall Authentication
A couple of us on campus use shh tuneling to access our private e-mail accounts on our home machine. Recently, "The Man" installed some firewall software that requires us to authenticate a connection to the 'net. If using Windows or Linux GUI, a standard dialog box pops up, you enter your username and password info click 'OK' and you're good to go.
From command line Linux, if you run something that needs access to the net, no prompt is displayed and the system hangs until a connection time out. We found a way around this by running lynx and requesting a common sit like www.somesite.com. lynx launches, requests the site, the firewall says "Hey, you're not authorized" then askes for a username. Code:
Username for 'FW-1. Reason: no user FW-1 ' at server 'XXX.XXX.XXX.XXX': Code:
Password: You now have an authenticated connection to the net to use as you please. The session expires after X minutes or X minutes of inactivity. (Haven't figured that one out yet. What we want to do is run a cron job that will automate the above process. 1) Launch lynx and request a site 2) Enter username and password when and if prompted We're stuck on how to automate the entry of the username and password. Anyone have any ideas? |
After seaching some related posts, I decided to read the lynx man page.
will do the trick. |
Or you might consider putting it in a conf file so that anyone who does a ps won't see your password.
|
Stickman...
Unfamiliar with the conf file. Do tell... |
From the man page for lynx:
-cfg=FILENAME specifies a Lynx configuration file other than the default lynx.cfg. Find the lynx.cfg (probably somewhere in /etc), and use it as a basis for a personal config file. |
Stickman... thanks. Will try.
All... New question... I worte two small shell scripts tunnel_start.sh and tunnel_stop.sh Code:
#!/bin/bash Code:
0 7-16 * * 1-5 /home/cfarley/lynx/tunnel_start.sh #> /dev/null 2> /dev/null Code:
Your Terminal type is unknown! I would also expect lynx to have authenticated the firewall prompt as it does if you execute the command from the command line. It did not. Any thoughts? |
You could use -dump or -source so that Lynx exits after it grabs the page the you don't need the second script to kill Lynx.
|
All times are GMT -5. The time now is 05:40 AM. |