A Hands-On Guide to Advanced FreeNAS Server Configurations
So you’ve taken my earlier advice and used the free and open-source FreeNAS operating system to convert an old desktop PC into a server, instead of consigning it to the e-waste heap. (If you haven’t, grab an old and otherwise useless computer, and start building. Go ahead, I’ll wait.)
Congratulations, you’ve saved your business a bundle of cash. You’re probably already using the server for client backups and a host of other tasks. Now I’ll show you how to enable some of the operating system’s more advanced features by configuring multiple user accounts, enabling its Snapshot shadow-copying service, and making the server easily accessible via the Internet so that you can access files when you’re away from the office or operate a secure FTP server for file sharing.
Set Up Multiple User Accounts
You could easily throw open your new server to everyone in the office, but you probably don’t want to give the folks on your sales team access to the same files your accounting department uses--and vice versa. That’s where FreeNAS’s powerful Users and Groups tools come into play.
Log in to the FreeNAS configurations screen with your administrator account, click the Users button beneath the Account menu, and select the Add User option. In the next screen, make sure that each User ID you’re entering matches the login name that each person uses to access their desktop computer. Give the user account a name, an associated email address, and a password, and then click OK.
The next step is to create groups into which you can organize users. Click the Groups menu in the left sidebar. Choose the Add Group option and assign a name to your collection of user accounts.
Finally, select the View All Groups option on the leftmost sidebar, and click the Members button for the group that you want to add new members to. Moving members into and out of each group is as easy as selecting their IDs and clicking the appropriate arrows.
Now click the big Storage icon in the upper-left corner of the FreeNAS configuration screen. Assuming that you’ve already created the storage volumes for your small business’s files (analogous to the root directories that users will access and build on), click the key icon to select a volume to which you want to grant a group access. When the Change Permissions screen appears, change the Owner (User) value to nobody, select the appropriate user group on the drop-down menu, decide on which read/write/execute permissions to grant the group, and check the Set Permission Recursively box. Click Change, and you’ll have successfully set up your first group-restricted network folder on your storage server.
This step assumes that you’ve configured your FreeNAS server’s storage using ZFS, as I outlined in the previous how-to.
Periodic Snapshot Tasks create a read-only version of a volume, so in the unlikely event that the server hiccups--or in the more likely event that you need to recover an older version of a file, or to rescue an accidentally deleted critical file--you can roll the server back to the point at which you took the snapshot. And snapshots don’t consume any storage unless a file has changed since the last snapshot.
To take a single snapshot of a particular volume, click the FreeNAS Storage icon, click the Volumes button, and then select View Volumes. To the right of the volume you wish to make a snapshot of, click the icon that looks like a small plus sign hovering at the upper right of a desktop PC. Make sure that Recursive Snapshot is checked, give the snapshot a name, and click the Manually Create Snapshot button.
If you’d like to schedule a series of automatic snapshots--at 1-hour intervals, let’s say--use the FreeNAS Periodic Snapshot feature. While still in the Storage menu, click Add Periodic Snapshot and enter the date, time, and interval for taking snapshots. You can also decide how long FreeNAS should retain each snapshot before it makes that space available for general storage once again. Note that Snapshots can be sizable if many large files are changed during each interval. Change five 200MB files, for instance, and the next snapshot will include ten 200MB files.
You have two methods of restoring files should disaster strike your FreeNAS volume. Your first option is to click the icon that resembles two computers connected together, which will convert the snapshot into a clone that operates as if it were a standard system volume. You can share it with users, copy files from it, and delete it when you’ve finished restoring whatever you needed to recover. Your second alternative is to click the icon that looks like a PC with an arrow over it--you’ll find it in the upper-right corner--to make the FreeNAS volume restore to its state at the time the snapshot was created.
Next Page: How to Set Up an FTP Server
Create an FTP Server
Most Internet service providers catering to small businesses (and consumers, for that matter) provide only one dynamic IP address with their standard service plans. They charge an extra fee for each unique static IP address.
Just as their names imply, a static IP address never changes, while a dynamic IP address does. (The concept of dynamic IP addresses came about because Internet Protocol version 4, or IPv4, was running out of unique addresses. The newer IPv6 has an all but inexhaustible inventory of addresses, but it’s still rolling out.)
The difference between dynamic and static IP address types is unnoticeable--until you try to access your server while you’re on the road, or you attempt to set up an FTP server for file sharing. If your server doesn’t have a fixed IP address, you won't be able to access it via the Internet reliably because its address might change. Fortunately, you have a workaround that’s much less expensive than paying for a bunch of static IP addresses.
Sign up with a third-party dynamic-DNS service provider (Dyn and No-IP are two examples), and you can create a unique and easy-to-remember name for your server--such as freenas.yourcompany.com--that the DNS service provider will map to your dynamic IP address. Your FreeNAS server will automatically update the service each time its IP address changes, so you’ll always be able to connect to the server from the Internet using the unique URL you've created.
Once you’ve signed up with a dynamic-DNS service, log in to your FreeNAS configuration screen, click Services, and then select Dynamic DNS. Choose your service provider from the drop-down list, enter your domain name, and enter the username and password for your dynamic-DNS account. The update period is the interval--measured in seconds--at which your FreeNAS server will update your dynamic-DNS service provider with its IP address. Contact your service provider for a recommendation, as updating too frequently could get you blacklisted.
You’ll also need to configure FTP service on your FreeNAS server, which involves establishing permissions and setting the port that it will use for network connection requests (typically port 21 for an FTP server). Now open the FreeNAS Control Services panel, and turn on FTP and dynamic-DNS services. The final step is to configure your router’s port-forwarding settings so that incoming FTP requests are forwarded to the FTP server running on your FreeNAS server.