With a Samba server installed and running on Linux, we can access partly or the whole system via LAN.
Install Samba:
apt-get install samba
Follow the install wizard and enter “workgroup” or the group your network uses.
The outside access can be configured for a special directory and for a special user or it’s possible to see the entire system. The latter can be used for administration purposes via LAN, but it’s not recommended for production servers or for paranoiac users.
Set up restricted access
- (On the server) add a directory for samba shares
mkdir /samba
(Change the /samba directory according to your needs)
- Add a usergroup for samba
groupadd sambagroup
- Give the directory to the group
chgrp sambagroup /samba
- Change the rights
chmod 0777 /samba
- Add a user
useradd -g sambagroup winuser
- Give the user a password
passwd winuser
- Add samba password. This will be the password to access the server.
smbpasswd -a winuser
- Enable user in samba
smbpasswd -e winuser
- Add the following to /etc/samba/smb.conf. Change the SambaShareName to a nice one.
[SambaShareName] path = /samba writable = yes public = no valid users = winuser force create mode = 0777 force directory mode = 0777
- Restart the Samba server (every time you make changes to /etc/samba/smb.conf, the Samba server needs to be restarted).
/etc/init.d/samba restart
Set up full access
It’s not a problem to give full access to the whole system if the server isn’t accessible from outside the router or the local area network is accessed only by the developer(s).
- Add samba password
smbpasswd -a root
- Enable user in samba
smbpasswd -e root
- Add the following to /etc/samba/smb.conf
[SambaShareName] path=/ writable=yes public=no valid users=root force create mode = 0777 force directory mode = 0777
- Restart the Samba server
/etc/init.d/samba restart
Note: in a Windows system, you will see the server as “SambaShareName”. Change this name accordingly.