Lynx: how to use -auth flag when username contains domain? - linux

I have a problem with Lynx. I'm trying to log in on a web page using the -auth flag. The line I use is
lynx -accept_all_cookies -auth=mydomain\myuser:mypass
http://ultracooldomain.com/default.aspx
This does not seem to work. What am I doing wrong (if I login with the same user/pass combination in Lynx it works)?
Thanks
Nocklas

Solved it using -auth=mydomain\\myuser:mypass

Related

How to Redirect to an URL in A Command line Inteface (CLI)

I Was Trying to make a redirection to an URL in A CLI Using nodejs.
How Can i do this? I Tried Using request, But i Dont know how.
What do you want to do?
I think you can use:
curl -v -L www.example.com
Or if you can be more specific...

How to secure the default apache karaf installation

Following Christian Schneider's blog post, How to hack into any default apache karaf installation, I checked to see if my default Karaf installation (4.0.5) is insecure:
Some simple steps to check if your karaf installations is open.
Check the "etc/org.apache.karaf.shell.cfg" for the attribute sshPort. Note this port number. By default it is 8101
Do "ssh -p 8101 karaf#localhost". Like expected it will ask for a password. This may also be dangerous if you do not change the default password but is quite obvious.
Now just do bin/client -a 8101. You will get a shell without supplying a password. If this works then your server is vulnerable
As expected. It is vulnerable. So I tried to secure it following the instructions as described:
How to secure your server?
Simply remove the public key of the karaf user in the "etc/keys.properties". Unfortunately this will stop the bin/client command from working.
Also make sure you change the password of the karaf user in "etc/users.properties".
I shut down the Karaf server using the halt command. Then I changed the karaf password in etc/users.properties and deleted the file etc/keys.properties. Then I started the server again with bin/karaf. Then in a new terminal I tested to see if the installation was secure by trying to ssh into the server. I validated that ssh login now requires the newly configured password. Finally, I tried using the bin/client -a 8101 command.
At this point, as explained in the blog post, I expected the command to fail:
Unfortunately this will stop the bin/client command from working.
I noticed after running bin/client -a 8101 there is a new file etc/host.key that either bin/client or the container itself auto generated. Rather than failing the command succeeded and I was presented with the Karaf console.
Does this means the container is still vulnerable to this attack vector?
No.
The modifications described in the OP (changing the default password in etc/users.properties and deleting etc/keys.properties) secures the container from that specific attack vector.
According to the discussion on the Karaf users mailing list concerning this stack overflow question:
By default bin/client tries (in this order) to use:
etc/keys.properties
etc/users.properties
karaf/karaf
-u to prompt for the password
bin/client is an SSH client (written in Java). The host.key is the same file as for SSH and containing the trusted hosts (you also have .sshkaraf/known_hosts for that).
The section quoted from the blog in the OP is out dated:
Unfortunately this will stop the bin/client command from working.

wget and htaccess: username only

I googled how to download images using terminal in ubuntu with wget. I found what I needed, but on the server, protected with .htaccess, there's no password. with
wget admin#http://server.com/filename.jpg
it returns: No route to hosts. When I set a password and type
wget admin:password#http://server.com/filename.jpg
everything's fine. However I am not allowed to use a password on the server. How to fix it, finding route?
Much easier:
wget --user="username" --password="password" http://xxxx.yy/filename.xxx
Try
wget --user=admin http://server.com/filename.jpg
instead.
Alternatively,
wget http://admin:#server.com/filename.jpg
may work instead.
Your syntax is actually wrong, as its:
wget http://user:pass#host/file
your username is outside the url, and was being treated as a hostname.

How can I check whether I have access to JBoss web console on a Unix environment over SSH

I've tried numerous google searches but nothing useful came up...I'm connecting via SSH and would like to see if I have access to the JBoss web console. Thanks for your response.
A first try would be:
lynx http://localhost:8080/web-console
A second try would be to connect with ssh -X and then:
firefox http://localhost:8080/web-console

File path for a Cron Job

Hi I want to run a cron job to call a PHP script on my server. I am using Cpanel from my web host and these are the options:
Minute:
Hour:
Day:
Month:
Weekday:
Command:
I am really struggling to point the command to my file I am using this line /home/abbeysof/public_html/adi/cron/daily.php but I am getting this error:
/bin/sh: /home/abbeysof/public_html/adi/cron/daily.php: Permission denied
I asked my web host for help and this is the response:
If you use cpanel to create it, it will fill in the path for you. Typically /home/username/public_html/etc
Can anyone please offer some advice?
Advise 1: use wget command, wget runs the PHP script exactly as if it was called from the web so the PHP environment is exactly the same of when calling the file from the web, it's easier to debug your script then.
wget -O - http://yourdomain.com/adi/cron/daily.php >/dev/null 2>&1
The cron jobs has to be created going into cPanel cron jobs menu. I don't understand if you have this clear by reading your hoster's answer.
And advise 2: change web hosting, try this one they don't leave you alone.
Sorry, I don't know anything about cpanel, but it sounds like:
if you created the file daily.php, then you need to change the permissions on it
if they created the file, then there's a bug in their creation routine.
Good luck!
try this one
/usr/bin/php -q /home/yourCpanelUsername/public_html/filename.php
for some cpanels it might be like this
/usr/local/bin/php -q /home/yourCpanelUsername/public_html/filename.php
Sounds like you need to make /home/abbeysof/public_html/adi/cron/daily.php executable.
The link might help you.
https://www.inmotionhosting.com/support/edu/cpanel/how-to-run-a-cron-job
There is difference if you are using VPS than sharing hosting for giving the command.
You may need to use user-agent & cPanel-Cron along with your url.
curl --user-agent cPanel-Cron http://example.com/cron.php

Resources