Home arrow News arrow Latest arrow Vista or XP Accessing Samba shares securely over SSH

Subscribe

No Spam just the latest tips from reviewingit.com






Article listings

Last comments

Windows Vista Missing Hibernat...
Thanks
It works. :) Thanks alot.
04/08/09 18:04 More...
By Levent Kaya

Windows Vista Missing Hibernat...
Thanks
It works. :) Thanks alot.
04/08/09 17:56 More...
By Levent Kaya

Create Invisible Registry Entr...
can anybody creat a key for Atomic Email Hunter 5.44 ??!! ...
31/07/09 16:08 More...
By benny

Vista DHCP and Router Problems...
The texts close to Clothing are published by the writing ser...
24/07/09 22:44 More...
By vfvd

Having fun downloading with Wg...
mast :( :x :x :zzz 8) :roll :grin
24/07/09 08:30 More...
By mast

Vista or XP Accessing Samba shares securely over SSH Print E-mail
User Rating: / 6
PoorBest 
Written by Administrator   
Monday, 20 August 2007

Image 

For those with Linux Servers I am sure that you have an SSH server setup. So when you transfer files you can use SCP or SFTP. But what about doing Samba over SSH? And especially if you are using a Windows environment. Port forwarding in SSH works for many applications but what about Samba? Forwarding port 139 for 127.0.0.1 some how or rather does not seem to work. Read on....

 

SSH is fantastic, it is probably the most fantastic piece of software running in Linux. Of course the rest is good. But SSH takes the cake.  You can practically forward any of your local ports to remote hosts or servers from your ssh server or even to the ssh server machine itself.

Lets forward Samba traffic with a few tricks in Vista

The first problem we have to deal with is forwarding port 139 on the localhost. Windows is always using port 139 on the local windows computer so forwarding port 139 will not work. What you have to do is you need to create a windows loopback adapter and then give an ip address let say 10.0.0.1

Ok First up lets install the loop back adapter

1. Go to your device manager and add legacy hardware

Image

2. Choose to manually install the driver

Image

3. Select Microsoft and the Microsoft loop back adapter

Image

4. Later select the loop back adapter and change the ipaddress, In this case I use 10.0.0.1

Image

Image

Next you have to configure putty to forward port 139 to your server. If you try connecting now you will notice that you will not be able to connect to your Samba server.  Well the trick is you have to also forward port 445, doing this will do the trick. Take a look at my putty configuration:

Image

In your source port key the address of your loopback adapter with the port you want to forward (e.g. 10.0.0.1:139) dont worry about the size of the field. Then next add the target server you want to forward to (My samba server is 192.168.1.2:139). Do the same for port 445.

After you do this Viola everything works... just access the Samba share like a regular windows share.

To be able to have the convenience of accessing Samba share in windows, five cool smilies...

CoolCoolCoolCoolCool

Hope this tip helps!!


Add as favourites (25) | Quote this article on your site | Views: 40332

Comments (18)
RSS comments
1. 06-07-2009 11:55
 
Nice tutorial
It's a very good short tutorial related to SSH on windows and Vista.I have searching for this article for a long time.I have to present about SSH in my class of 70-528 exam.I really happy to find this comprehensive post.
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
2. 31-12-2008 08:55
 
Nice tutorial
To get it to work with a fully updated Vista see this: 
http://social.technet.microsoft.com/Forums/en-US/itprovistanetworking/thread/d30d3c98-58c5-47f6-b5a5-f5620882020d/#page:2
Guest
 
Kalmi
3. 02-12-2008 15:47
 
Problem VISTA
This solution works great with my XP client. But I can't make it work with a VISTA Client. I don't understand where I'm wrong. 
PS. 445-tunnel is configured. 
 
An idea ?
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
4. 03-11-2008 23:16
 
Problem VISTA
Please help me get this issue noticed and something done about it on the MS forums, 
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=4082092&SiteID=17&mode=1
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
5. 14-10-2008 20:31
 
Great article
Worked like a charm. Thanks for sharing your thoughts!
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
6. 18-07-2008 17:23
 
Developer
@ Sri 
RTFM Dude! Or at least read the entire post. 
 
@ Dennis Allard 
From what I've divined thus far Vista Sucks badly enough that you CANNOT port forward 445 (AT THIS TIME)
Guest
 
7. 07-07-2008 14:19
 
How to access ssh using putty over samba
I have setup samba server and putty on client machine . Can anybody tell how to securely access samba using ssh :?
Guest
 
sri
8. 27-06-2008 18:20
 
Willing to pay someone to get this worki
Who wrote this article? 
 
I would like to contact the original 
author of this article or any reader 
who can successfully create a tunnel 
from my Vista laptop to my Linux 
Samba server. 
 
Please contact me at the above email 
address. 
 
Thanks, 
Dennis
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
9. 09-06-2008 02:04
 
Vista, so safe it won't let me use it t
Wow, Window's Vista is so SAFE, I can't even use it! 
 
Even after removing both: 
WinVista SP1 
AND KB942624 
 
I AM able to forward port 80 no problem! 
 
I have no success forwarding port 445! 
 
I'd love to get this resolved, any help would be appreciated, you can email me at nospam (aht) davem (daut) (CoM)
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
10. 04-06-2008 09:41
 
Reason behind the whole wham bang
So many questions on this... ok firstly to do this you must have a linux server running ssh in order to do this.. so it will look like this  
yourpc->linuxsshserver->pcwithwindowshare 
 
So the windows sharing passes through an encrypted ssh tunnel this is achieved by forwarding the traffic going to 127.0.0.1 to putty which passes it to the ssh server which then sends the traffic to the pc with windows share. 
 
So the idea of it all is to create a sort of VPN using ssh port forwarding to access your windows shares securely from say a remote location.
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
11. 03-06-2008 20:52
 
Port forwarding?
I don't really understand the reasoning behind port forwarding.
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
12. 03-06-2008 17:26
 
Port forwarding?
Don't work with Vista SP1, i Vista patch KB942624 already installed on SP1?
Guest
 
januarius
13. 26-02-2008 16:41
 
Ports
For the record, it appears that both ports (139 and 445) work equally well for this in Vista, so try both. 
 
Vista has broken so many OSS apps it's not even funny.
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
14. 26-02-2008 08:05
 
Excellent but more detail please
Thank you for taking the time explainng how to make things work. Unlike a lot of success stories about Linux you take the time to use pictures. One thing to make things clearer is where are all the components mentioned operating? Is the windows system the samba server?, where is putty running and how is it or ssh part of the traffic? What part of your system is finally accessing the samba share. Not clear what indicated success. :?
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
15. 06-02-2008 17:44
 
Problem with KB942624
This guide didn't work for me, first. But then I found out that the Vista patch KB942624 breaks port 445 forwarding which caused my problems. So after uninstalling this patch everything worked fine.
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
16. 30-12-2007 12:43
 
smb4pma
So what about the reverse? 
I have a PMA430 and using one of your other tips I can see the PMA fine from Vista. BUT, I can not see the Vista shares from the PMA. 
Actually, I can see the shares, but I can not access the folders, they're just questions marks in the File Browser of the PMA. Suggestions?
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
17. 14-12-2007 15:47
 
SMB
FYI, newer versions of Windows only use port 445. You don't need to worry about port 139 anymore.
Guest
 
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
18. 24-11-2007 17:51
 
how is this done in Linux?
This is great. Now how do I do this in Linux without having to disable the Samba server on the localhost? Even if I do disable the Samba server on the localhost, I have to be root to forward port 139.
Guest
 
Pollywog

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Personal verbal attacks will be deleted.
  • Please don't use comments to plug your web site. Such material will be removed.
  • Just ensure to *Refresh* your browser for a new security code to be displayed prior to clicking on the 'Send' button.
  • Keep in mind that the above process only applies if you simply entered the wrong security code.
Name:
E-mail
Homepage
Title:
BBCode:Web AddressEmail AddressBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
Comment:



Code:* Code
I wish to be contacted by email regarding additional comments

Powered by AkoComment Tweaked Special Edition v.1.4.6





Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!Add this social bookmarking functionality to your website! title=
Last Updated ( Friday, 24 August 2007 )
 
< Prev   Next >

Site Search

Sponsors

Google