Using SSH with Other Services / Using SSH with Other Services
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
I'm going to show you another interesting trick you can use with SSH, and that really involves using it with other protocols. Now, Secure Shell, as you know, is a secure protocol, but it can also work with other protocols even ones that are inherently non-secure. You can do what's called tunnelling or forwarding and you can take protocols and put them through SSH, through an SSH encrypted session. You can tunnel protocols through, you can also forward one protocol from one port to another, and you can do this with a wide variety of protocols: http, ftp, and so forth, over a secure shell. I'm going to show you just quickly how to do that how to forward from one port to another and in this example, we're actually going to use a computer that has no Internet access that can connect to another computer that has Secure Shell running and does have Internet access; how it can use that Secure Shell tunnel to get to a particular website. So, let's go ahead and look at that. OK, we're on computerB and what we're going to show you first is that we have no Internet access because we're in a private network, 172 dot 16. 30. 20, or 30. 30 rather, is our network address, so we're on a private non-writable network address, and as you can see we have no network connectivity. So, let's go ahead and forward a port on SSH and what we're going to do is we're going to try to get to a particular Internet site, let's say www dot vtc.com and we're going to forward that to a local port through a machine that is also running Secure Shell and does have Internet access, so let's see how this works. I'm going to ssh -L, and that's the switch to tell SSH to listen out on a particular port. We're going to tell it the port we want to forward it to, which is 34567, and we're going to say that we want www vtc.com, and that will be on a request from Port 80, and the computer we want to connect to that's using Secure Shell and has Internet access is 172 16. 30. 20, of course, computerA. So, that's how we set this up, and then we're going to tell it to listen out on this port, we're going to type our password. It didn't take our key for some reason, but it will allow us to login with a password, so we're logged in Secure Shell, and now we're going to go to this particular, this particular site. And again, we don't have Internet access. We can try it again. We still don't, however, if we go to localhost and hit that port that we mapped, and guess what we're going to get, we're going to get the VTC site. Of course we're not rendering all the graphics and such, but we are connected to the site. So what we've done is we've forwarded Port 80 through to 34567 on our local machine, and we've done that through another machine, and this is all over SSH. So, this is a very rudimentary example, and maybe not a useful thing you could do, forwarding to one particular website, but you can do this with any other protocol you want as well. Let's say you have an application an older application that must use ftp, it can't use Secure Shell, well, then you might want to take that application and listen out for ftp on Port 21 and forward any requests through SSH through to the other side over a secure connection. So you can forward and tunnel unencrypted protocols, insecure protocols across SSH as well. This was just a quick example to kind of show you how that works and how to do it. So, that's really all there is to Port Forwarding and Tunnelling, and of course if you use your imagination and do a little research, you could probably figure out how to use this to your advantage when you're having to deal with unsecure protocols when you have to use them.
Tutorial Information
| Course: | MasterClass! - Using Secure Shell (SSH) |
| Author: | Bobby Rogers |
| SKU: | 33976 |
| ISBN: | |
| Release Date: | 2009-03-13 |
| Duration: | 2 hrs / 20 lessons |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 