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?
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:
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:
Then run the command to automatically submit the first form on a webpage:
The problem then is quitting elinks, you may have to kill it in your script.