Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
12-28-2013, 11:23 AM
|
#1
|
LQ Newbie
Registered: Dec 2013
Posts: 14
Rep: 
|
SSH Tunneling problem
I think this is the right section to post this? Anyway I have a problem with this. So basically I am practicing SSH tunneling in Linux. I found a free proxy server list that I want to connect to and I used this:
ssh -D localhost:9100 www.proxyweblist.com
But for some reason this asks me for a unknown password which I don't know. I inputted my user password and it did not work, what password are they asking me? What is the problem? I am a newb at this atm, I am going to learn openSSL next week in my cryptography course and I don't even know how to SSH tunnel.
Edit -- If this is in the wrong section ( I am fairly certain SSH tunneling falls under Networking even though I am learning it in a Cryptography course and not in Networking course, don't ask me why lol) can it please be moved, thanks.
I have also tried other websites and the same thing, asking me for a unknown password? Also some websites refuse connection?
Last edited by Sasuke92; 12-28-2013 at 12:04 PM.
|
|
|
12-28-2013, 12:31 PM
|
#2
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
ssh is a secure, encrypted protocol that requires a username and password to connect (or a private/public key pair). Does this free proxy server include ssh access? If so, that's the username and password you need to use.
|
|
|
12-28-2013, 12:34 PM
|
#3
|
LQ Newbie
Registered: Dec 2013
Posts: 14
Original Poster
Rep: 
|
This is the problem I get when I ran ssh -v
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
My user password doesn't work.
|
|
|
12-28-2013, 12:56 PM
|
#4
|
Moderator
Registered: Aug 2002
Posts: 26,516
|
You would need to know the username and password on the server.
www.proxyweblist.com is just a site that lists free proxy servers and not meant to be used as a tunnel. These free proxies basically let you browse the web anonymously and bypass filters. Most are web/cgi sites where you enter the website that you want to browse in a form.
If you want to practice tunnelling you can use your own PC.
|
|
|
12-28-2013, 01:09 PM
|
#5
|
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983
|
in addition to what has been mentioned read the links in my signature. in short you dont need an external site to practice SSH, you can SSH locally.
Code:
$ ssh local_user@127.0.0.1
will SSH into yourself on your local computer. this works just as well as what you are attempting to do without proper permissions.
you can also practice setting up your ssh keys this way and using both keyless and key paired access to your own Linux system.
|
|
|
12-28-2013, 07:51 PM
|
#6
|
LQ Newbie
Registered: Dec 2013
Posts: 14
Original Poster
Rep: 
|
Ohhhh ok. So I can ssh MYSELF and that would encrypt my data? And how can I check if my data is encrypted? Is there a program where I can see results of plaintext and cyphertext internet traffic? Do I need wireshark for that?
I thought I had to ssh another server so then my wan IP would be anonymous if you are at a public wi-fi spot or something (university scenario). Isn't that the point of ssh tunneling? I may be getting confused here lol
I will definitely look at your threads lleb.
Sorry for so many questions but this is even more interesting than my data forensic course lol
Last edited by Sasuke92; 12-28-2013 at 07:53 PM.
|
|
|
12-28-2013, 07:57 PM
|
#7
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
He was saying that you could ssh to yourself to practice tunneling and ssh access. This will not have any advantage when it comes to surfing on an unsecured wifi network though, for that you would need to ssh to another machine off-site that has a "secure" connection you can tunnel your traffic through. I do this regularly when I'm on travel. I set up an ssh tunnel from my laptop to my server back at home, and tunnel my web traffic through it.
You cannot ssh into any old address though, you can only access it if they have specifically provided you with ssh access, with an associated username and password.
Last edited by suicidaleggroll; 12-28-2013 at 07:59 PM.
|
|
|
12-28-2013, 08:09 PM
|
#8
|
LQ Newbie
Registered: Dec 2013
Posts: 14
Original Poster
Rep: 
|
I just ran
ssh -D 8876 localhost
And I set the proxy settings on the settings page in Firefox to localhost and the port number. Does this mean I have successfully encrypted my data from plaintext to ciphertext when I am browsing the internet? Because it doesn't seem to be working, when I hover my cursor over some websites, it says "my connection to this website is not encrypted".
Thanks for the replies btw, I know it sounds like a pain but this interests me greatly.
|
|
|
12-28-2013, 08:21 PM
|
#9
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Quote:
Originally Posted by Sasuke92
And I set the proxy settings on the settings page in Firefox to localhost and the port number. Does this mean I have successfully encrypted my data from plaintext to ciphertext when I am browsing the internet?
|
No
Essentially, your browser is running through an encrypted tunnel to your own computer, and then going out to the WWW unencrypted.
Even if you do tunnel properly, unencrypted websites will not report that your connection is encrypted, because it's not. Your data is encrypted to the proxy server (whatever that may be), and then unencrypted from there. As far as the website is concerned, everything is unencrypted, it just thinks the traffic is coming from IP A, when it's really coming from IP B (which is then tunneled through IP A).
Last edited by suicidaleggroll; 12-28-2013 at 08:23 PM.
|
|
|
12-28-2013, 08:25 PM
|
#10
|
LQ Newbie
Registered: Dec 2013
Posts: 14
Original Poster
Rep: 
|
So if ssh doesn't encrypt the data which is forwarded to the net, what is the use of it? Because I was taught that SSH encrypts the packets at the application layer into ciphertext? Or the tutor didn't know what she was talking about lol
Last edited by Sasuke92; 12-28-2013 at 08:27 PM.
|
|
|
12-28-2013, 08:35 PM
|
#11
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Maybe an example would help.
When I'm on travel, I'm often using open wifi networks. Anything I do on those networks is unencrypted and available for snooping. Let's say I'm staying at a Holiday Inn Express and feeling extra smart. I'm using their wifi, which has a public IP address of 123.456.789.123. If I go to www.whatismyip.com, it will report 123.456.789.123. Any website I go to sees that I'm coming from 123.456.789.123, and if the data is unencrypted, it's unencrypted, and anybody can listen in.
Now, because I'm at a Holiday Inn Express and feeling extra smart, I decide to tunnel my traffic through my home computer to protect myself. My home computer is, naturally, sitting in my home on a protected private LAN with its own connection to my ISP. Nobody can listen in on traffic from my home computer except my ISP. It's as secure as you can get. So, from my laptop at the hotel, I run:
Code:
ssh -ND55555 user@home
Where "user" is my username on my home computer, and "home" is the IP of my home computer, let's call it 111.222.333.444. I enter my password and the tunnel is open. I then launch my web browser using this tunnel:
Code:
google-chrome --proxy-server="socks://localhost:55555"
Now is where the fun begins. Any site I try to access from this web browser session will pass through the tunnel to my home computer, and go to the WWW from there. If I go to www.whatismyip.com, it doesn't report 123.456.789.123, it reports 111.222.333.444, since that's where the traffic is coming from as far as they're concerned. Any data I transmit through this web browser, any website I go to, the data passes through the encrypted ssh tunnel to my home computer, and then goes unencrypted to the WWW from there. Anybody listening in on the hotel's open wifi network just sees encrypted garble passing between my laptop and 111.222.333.444. If there were anybody listening on my home network, they would be able to see my requests in plaintext, but there isn't anybody listening on my home network, since my home network is private and protected.
In essence, the data being transmitted to the web server is always unprotected (if it's an unprotected site). What tunneling gets you is an encrypted connection from your current location to a private location, where the data can be sent unsecured from there without risk of snooping.
Last edited by suicidaleggroll; 12-28-2013 at 08:40 PM.
|
|
1 members found this post helpful.
|
12-28-2013, 08:42 PM
|
#12
|
LQ Newbie
Registered: Dec 2013
Posts: 14
Original Poster
Rep: 
|
Thanks, I understand your whole post up to this point:
Quote:
"and then goes unencrypted to the WWW from there"
|
I understand that you have successfully created a tunnel, you are using your home network as the anonymous source, and whatever you are typing is encrypted. Right, but then why does your HOME NETWORK decide to all of a sudden decrypt it and send it to the web unencrypted? W hat if someone snoops on that? Didn't that just make your effort meaningless if what you send is encrypted at the beginning, but at the destination its unencrypted?
|
|
|
12-28-2013, 08:50 PM
|
#13
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
It has to be unencrypted at the destination. How could www.google.com possibly understand what you're trying to type into the search box when the characters you're typing are encrypted?
The web server you're ultimately trying to access has to receive unencrypted data. What tunneling gets you is the ability to move the source of this unencrypted plaintext transmission from your current, unprotected, snoopable network to a private, secure network that nobody can listen in on.
|
|
1 members found this post helpful.
|
12-28-2013, 08:52 PM
|
#14
|
LQ Newbie
Registered: Dec 2013
Posts: 14
Original Poster
Rep: 
|
Edit --
Didn't see your edit and now your new post lol sorry :P
I fully understand now. So its similar to public key cryptography where a public key is used to encrypt and a private key is used to decrypt. I originally thought I could SSH just myself and have encrypted connection, seems like I need to find a server now.
Last edited by Sasuke92; 12-28-2013 at 08:56 PM.
|
|
|
12-28-2013, 09:06 PM
|
#15
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Yeah, sorry, I tend to edit my posts to improve clarity, fix typos, etc.
You are absolutely correct. You need to have a remote SSH server available in order for tunneling to have any tangible effect. Not only that, but this SSH server needs to be on a network that you trust, otherwise you might as well just surf the web normally from your current location. You probably won't find any free proxy servers that provide SSH access. You'll either need to pay for that service, or use a server that is already under your control, such as a machine on your or a friend's home network.
Last edited by suicidaleggroll; 12-28-2013 at 09:21 PM.
Reason: typo
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 02:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|