Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to set up a folder that can be accessed via Windows clients over the net on my Linux VPS on which our companies website resides.

I know a little bit about Linux, and have used Samba before to browse Windows shares from a Linux laptop. I'm guessing it's possible to do the reverse - to share a folder from Linux TO a Windows client.

I have root SSH access to the VPS, would anyknow know what steps I need to take to set up the share, and how I can secure it, ideally with a simple username/password so the Windows clients can connect easily?

Many thanks,

Jack

share|improve this question
1  
My instincts tell me this is a dangerous thing to do on the public internet; if it is done within a VPN then no problem. –  PP. Feb 24 '10 at 16:54
add comment

2 Answers

Most ISP's block SMB traffic at their routers-so more than likely your clients won't be able to mount the share from outside the VPS providers network.

Configure these lines in smb.conf to setup a Samba share

[sharename]
comment = Insert a comment here
path = /home/share/
valid users = tfox carole
public = no
writable = yes
printable = no
create mask = 0765
share|improve this answer
add comment

I'm not so sure using Samba over the internet is very safe, but I have set up sharing with Samba from a Linux machine and documented my steps and I'll share that with you.

First off, you're gonna need to open up a couple of ports in your firewall. 137 UDP, 138 UDP, 139 TCP, 445 both UDP & TCP

Next, edit your settings and define your shares in the /etc/samba/smb.conf file*
Here's mine:

\#======================= Global Settings======================  
[global]  
    workgroup = MYGROUP
    server string = Samba Server Version %v  
    netbios name = NAS  
    hosts allow = 127. 10.  
    security = user  
    passdb backend = tdbsam  
\#====================== Share Definitions =====================  
[Public]  
    comment = Public  
    path = /shares/Public  
    public = yes  
    guest ok = yes  
    writable = no  
    printable = no  
[upload]  
    comment = upload  
    path = /shares/Public/upload  
    public = yes  
    guest ok = no  
    writable = yes  
    printable = no  
    valid users = myusername

* location may vary according to distro, I used CentOS

Now obviously your "hosts allow" section should be adjusted to allow your client. Some security measures are in place in this example config, so that the upload folder is only accessibly by 'myusername', which is a linux user account on the server. The public folder however is wide open to everyone, although it is read-only.

If your smb service is running and the right firewall ports are open, this should work.

Good luck!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.