Difference between revisions of "Configure SMB"

From Organic Design wiki
(Samba)
Line 5: Line 5:
 
}}__NOTOC__
 
}}__NOTOC__
  
== SFTP ==
+
== Samba ==
 +
The main issue with the initial configuration of Samba on the LAN server concerns the users and groups. What is the origin of the user/group information? and how does samba synchronise to it or use it to authenticate? Since all our servers run a wiki we decided to make the wiki the source of the users, passwords and groups information. To do this we instruct the local wiki daemon to set the unix and samba passwords whenever one is changed in the wiki. The wiki user's groups determine the share's ''valid users'' and ''admin users'' directives.
 +
 
 +
== Internet access using Samba over VPN ==
 +
This is basically just a normal Samba installation which is included in the [[install a new server]] procedure, but Samba is not a very secure protocol, and so if used to share resources to Internet clients, it must be protected with a [[w:VPN|VPN]] and so is probably only the best solution for file sharing if your organisation is already using a VPN to connect remote users into your LAN.
 +
 
 +
Once a [[w:VPN|VPN]] has been set up with the [[install a new VPN]] procedure, all the workstations which are connected to the same VPN connection form part of a "virtual LAN" and they can all publish and use resources shared in that LAN such as shared directories, printers and services. They all show up in the normal "network places" or equivalent even though the hosts can be located in diverse locations around the internet, and all these connections are encrypted and secure.
 +
*To ensure that Samba ports are only exposed to the private VPN side, set the ''interfaces'' directive in ''/etc/samba/smbd.conf'' to ''tun0''.
 +
 
 +
== Internet access using SFTP ==
 
The first method is [[w:SFTP|SFTP]] which uses existing [[w:SSH|SSH]] protocol to transfer files, and the workstations can map this connectivity in to the file system like a normal file share.
 
The first method is [[w:SFTP|SFTP]] which uses existing [[w:SSH|SSH]] protocol to transfer files, and the workstations can map this connectivity in to the file system like a normal file share.
 
*Don't forget that additional users created with ''adduser''' also need to be added to ''AllowedUsers'' in ''/etc/ssh/sshd_config''
 
*Don't forget that additional users created with ''adduser''' also need to be added to ''AllowedUsers'' in ''/etc/ssh/sshd_config''
Line 15: Line 24:
 
On Ubuntu, SFTP integration with the file system is a standard feature, simply go in to ''Places/Connect to server'', select ''SSH'', fill in the authentication details and the resource will be mounted as usual.
 
On Ubuntu, SFTP integration with the file system is a standard feature, simply go in to ''Places/Connect to server'', select ''SSH'', fill in the authentication details and the resource will be mounted as usual.
  
=== Setting up access for Windows workstations ===
+
== See also ==
Unfortunately, the Windows client setup isn't quite as simple as the Ubuntu case, but there is a good application for integrating SFTP in to the FS called [http://dokan-dev.net Dokan]. There are a few other components to install onto the Windows machine before it's ready to map SSH drives as follows:
+
*[http://oreilly.com/catalog/samba/chapter/book/ch06_02.html Controlling access to shares]
*Install the Microsoft .Net framework starting [http://www.microsoft.com/downloads/details.aspx?familyid=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en here] (63MB)
 
:''Note, say "no" to the strongly recommended upgrades, as they're nothing to do with this procedure''
 
*Install the [http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)]
 
:''Note, if this one fails, try skipping this one it may already be installed''
 
*Download and install the main ''Dokan'' library from the [http://dokan-dev.net/en/download Dokan downloads page]
 
*Finally download and install Dokan's SSH support (''Dokan SSHFS'') also from the [http://dokan-dev.net/en/download Dokan downloads page]
 
*When you fist run ''Dokan'', you must create a profile for each remote mount you want to connect to. This is so that each ones settings can be selected quickly from the drop-down list by unique name.
 
 
 
==== Operation ====
 
After installed, you should copy the ''Dokan'' icon from the ''start menu/programs'' menu onto the quick launch on the taskbar so that you can run it at any time with a single click (you can copy an icon from the start menu by dragging and dropping it while holding down the ''CTRL'' key).
 
 
 
When you run ''Dokan'', the login form comes up and you must select one of the profiles, enter the password and click connect. An icon for it will then show up in the system tray by the clock.
 
 
 
The icon in the system tray has a right-click menu with two options, ''exit'' which closes it down completely, and ''mount/dismount'' which allows you to connect and disconnect the drive without needing to re-enter the password.
 
 
 
== Samba over VPN ==
 
This is basically just a normal Samba installation which is included in the [[install a new server]] procedure, but Samba is not a very secure protocol, and so if used to share resources to Internet clients, it must be protected with a [[w:VPN|VPN]] and so is probably only the best solution for file sharing if your organisation is already using a VPN to connect remote users into your LAN.
 
 
 
Once a [[w:VPN|VPN]] has been set up with the [[install a new VPN]] procedure, all the workstations which are connected to the same VPN connection form part of a "virtual LAN" and they can all publish and use resources shared in that LAN such as shared directories, printers and services. They all show up in the normal "network places" or equivalent even though the hosts can be located in diverse locations around the internet, and all these connections are encrypted and secure.
 
*To ensure that Samba ports are only exposed to the private VPN side, set the ''interfaces'' directive in ''/etc/samba/smbd.conf'' to ''tun0''.
 

Revision as of 11:08, 23 May 2009

Procedure.svg Configure SMB
Organic Design procedure

Samba

The main issue with the initial configuration of Samba on the LAN server concerns the users and groups. What is the origin of the user/group information? and how does samba synchronise to it or use it to authenticate? Since all our servers run a wiki we decided to make the wiki the source of the users, passwords and groups information. To do this we instruct the local wiki daemon to set the unix and samba passwords whenever one is changed in the wiki. The wiki user's groups determine the share's valid users and admin users directives.

Internet access using Samba over VPN

This is basically just a normal Samba installation which is included in the install a new server procedure, but Samba is not a very secure protocol, and so if used to share resources to Internet clients, it must be protected with a VPN and so is probably only the best solution for file sharing if your organisation is already using a VPN to connect remote users into your LAN.

Once a VPN has been set up with the install a new VPN procedure, all the workstations which are connected to the same VPN connection form part of a "virtual LAN" and they can all publish and use resources shared in that LAN such as shared directories, printers and services. They all show up in the normal "network places" or equivalent even though the hosts can be located in diverse locations around the internet, and all these connections are encrypted and secure.

  • To ensure that Samba ports are only exposed to the private VPN side, set the interfaces directive in /etc/samba/smbd.conf to tun0.

Internet access using SFTP

The first method is SFTP which uses existing SSH protocol to transfer files, and the workstations can map this connectivity in to the file system like a normal file share.

Setting up access for Ubuntu workstations

On Ubuntu, SFTP integration with the file system is a standard feature, simply go in to Places/Connect to server, select SSH, fill in the authentication details and the resource will be mounted as usual.

See also