Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am on a network with a firewall that requires a username / password. I want to write a script to do some automated yum installs (specifically, tools to mount an nfs) but first I need to go to a web page in lynx and login to get past firewall. Is there any way I can pass a user / pwd argument to lynx from terminal so it logs in automatically?

share|improve this question
up vote 1 down vote accepted

I don't know of a way via lynx, but there's a few things you could attempt with curl or elinks, depending on the configuration of the login page.

If it's just basic proxy authentication, you can try passing the username and password via curl:

 curl -u username:password

You can also use curl to do more complicated logins, storing session cookies and such. Check out "Using cURL to automate HTTP jobs"

Finally, you may be able to do this in a dirty way using ELinks. ELinks has a function to save a username and password, and also a command line switch to automatically submit a form. By combining the two, this may be what you need:

Enable password saving in elinks.conf by adding this line:

set document.browse.forms.auto_submit = 1

Then run the command to automatically submit the first form on a webpage:

elinks -auto-submit 1

The problem then is quitting elinks, you may have to kill it in your script.

Good luck.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.