LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 05-08-2012, 11:34 AM   #1
lekhtuz
LQ Newbie
 
Registered: May 2012
Posts: 3

Rep: Reputation: Disabled
Smile https over ssh problem


Hello,

I will highly appreciate if somebody could help me sort out the following issue:

The following command works normally when I run it on host1:

curl -k -d param=value https://webhost/path (-k is necessary because the webhost does not have correct certificate installed)

I receive whatever web page is returned.

If I do the following while working on host2:

ssh -f -L 14141:webhost:443 host1 -N
curl -k -d param=value https://host1:14141/path

the result is always 301 Moved Permanently.

In all other respects, ssh between host1 and host2 works flawlessly.

The desired result is that webhost thinks that http request comes from host1 which IP is whitelisted as opposed to host2. Is there a simpler way to achieve it?

Thank you for your help.
Dmitry
 
Old 05-09-2012, 04:09 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
you probably have issues with the Host header, as it will be asking the web server for the "host1" website instead of "webhost" So you could add '-H "Host: webhost"' to the curl command OR use putty for a SOCKS proxy / Dynamic forward, not a static, using "-D 1234" on ssh and "--sock5-hostname localhost:1234" on the curl command and using the original full hostname as you currently do from host1.
 
Old 05-09-2012, 08:39 AM   #3
lekhtuz
LQ Newbie
 
Registered: May 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Chris,

Thank you for your reply. I will try it later today.

Also, the second curl command is actually localhost:14141, not host1:14141.

Dmitry
 
Old 05-09-2012, 01:20 PM   #4
lekhtuz
LQ Newbie
 
Registered: May 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Unfortunately -H did not help. I provided -H "Host: <whitelisted IP address>". I don't think it is that easy to fool the web server.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] if visiting an https website is there any added benefit to tunneling through ssh? nkoplm Linux - Security 3 04-05-2011 06:36 PM
Fedora 14 as a public (https, ssh) server Gavin Harper Fedora 1 01-25-2011 06:58 PM
[putty&ssh] Who is really good & expert in ssh https tunnelling and firewalling ? Xeratul Linux - General 12 12-03-2006 04:22 AM
Howto do Secured ssh from port https or port80(standard) to ssh d listening port 22 ? Xeratul Linux - General 4 11-23-2006 07:09 AM
SSH HTTPS Access jfr1272 Linux - Networking 0 05-29-2003 01:38 AM


All times are GMT -5. The time now is 05:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration