For a quick, easy, and free file-sharing appliance, look no further than TurnKey Linux. Learn how to set up users and add them to shares.
TurnKey Linux offers handy virtual appliances, ranging from a basic LAMP stack to an LDAP appliance and much more. If you need to spin up a file-sharing appliance in a hurry, the TurnKey Linux file server cannot be beat. By employing basic, off-the-shelf hardware or a virtual machine, you can get a solid SMB, SFTP, NFS, WebDAV, and rsync file server running in no time.
Getting a TurnKey Linux appliance up and running is simple. Follow these steps.
- Download the ISO.
- Fire up your virtual machine tool (I prefer VirtualBox).
- Create a new virtual machine.
- Attach the ISO to the machine.
- Make sure to change the networking to bridged (in the case of VirtualBox).
- Fire up the appliance.
In the case of the file server appliance, you'll want to log into the Webmin console at the address https://IP_OF_SERVER:12321 (IP_OF_SERVER is the actual address displayed on the virtual appliance screen - Figure A).
All the addresses you need in one location.
When you log into the Webmin console, the user is root, and there is no password--you'll want to immediately change that. Click System | Change Passwords, click the root user, type/verify the new password, and then click Change. With that out of the way, we can create a new user.
Creating a user
There are two steps to creating a user for shares. The first step is to create the user by going to System | Users And Groups. In the new window (Figure B), click Create A New User.
Creating a new user from within the Webmin console
The new user screen is simple--just answer the questions (make sure to set a password) and click Create. There are a number of questions offered, but most of the defaults will work fine. At this point, you probably haven't created any groups yet, so it's unlikely that you'll need to add the new user to a group.
Note: I highly recommend creating groups (which is done in similar fashion to creating users), adding users to the newly created groups, and then associating a group to the share. This makes it much easier to manage, as opposed to having to always add multiple users to a share.
Once the new user is created, you have to convert the user to a Samba user. Without taking care of this step, the user will not be able to authenticate to any shares on the system. To do this, follow these steps.
- Log into the TurnKey File Server as root.
- Click Servers | Samba Windows File Sharing.
- Scroll down and click Convert Users.
- Type in the name of the user to convert* (Figure C).
- Click Convert Users.
* If you need to convert multiple users, you can do so by entering a UID (User ID) range (found on the Users & Groups page) like so: 1000-1011.
Converting a current user to a Samba user
Any Samba user can access the default shares on the File Server system (out of the box, there is only one shared folder called storage).
Creating new shares
- Log into the TurnKey File Server Webmin console as root.
- Go to Samba Windows File Sharing.
- Click Create A New File Share.
- Give the share a name (Figure D).
- Enter the path for the directory to be shared (I recommend placing the new share in /srv, so it's easily viewable when browsing).
- Select if the share needs to belong to a specific owner or group.
- Enter a comment (optional).
- Click Create.
Creating a new share on the system
After you create the share, more options will be available. Click the share in the File Share listing and then click Security and Access Control. In this window, you can set more granular security controls, deny/allow hosts, and more.
The way you connect to the share will depend upon the platform you use. From a standard Linux file manager, I can go to smb://IP_OF_SERVER (IP_OF_SERVER is the server's actual name) and enter the credentials of a Samba user on the TurnKey Linux file server system, and I'll be presented with a listing of the shares available to that user (Figure E).
elementary OS Loki ready to make use of the Samba shares.
Make it yours
There's much more to the TurnKey Linux FileServer appliance than simple file sharing. Dig into the Webmin console, poke around, and see just how much more you can get out of this incredibly easy to use file-sharing appliance. You'll be surprised at how well it will serve you.
- Free Nethserver might be the small business server you're looking for (TechRepublic)
- How to add virtual hosts to NGINX (TechRepublic)
- How to test drive the free OnlyOffice Community Edition server (TechRepublic)
- How to set up quick and easy file sharing with Samba (TechRepublic)
- Linux rules the world. Where to next? (ZDNet)
- Shadow IT Policy (Tech Pro Research)