Low End Mac's Online Tech Journal

AppleShare on Linux

L Victor Marks - 2001.08.28

You've got a spare PC. You've just come over from the Dark Side™ and are wondering what do with the old beige Pentium-based machine?

Or maybe you've used Macs forever and are looking at a way to allow a large number of users have share files on a central server.

In either case, with a cheap PC (or even an expensive one) you can install Linux and AppleTalk services for Linux and have large amounts of hard drive space available for many users.

Linux has no limitation on the number of users

The benefit is that Linux has no limitation on the number of users that can be simultaneously logged in and no limit on how many users you may set up sharing for. Jeff Adkins recently wrote on article on Low End Mac about the so-called "Wall of Ten," a limitation of File Sharing that restricts the number of users with access in the following ways:
  • No more than 10 folders can be "share points" at one time. A "share point" is a folder or drive volume which appears on the network as a device you can connect to remotely. You can share many more than 10 folders within a single share point, but they cannot be logged into separately. So if you wanted to have a folder for every user, secure from other users' eyes, 10 is your limit.
  • No more than 10 users can be connected simultaneously.
  • No more than 100 users can be listed in your Users and Groups file. (Most teachers, at least in high school, have well over 100 students.)

Apple Knowledge Base Article 15460 describes these limits in more detail. (Please note, the above was shamelessly stolen from Jeff's article. It'll do you good to read it.)

As with any new software package, pay attention to the system requirements. Linux is growing, and the list of hardware compatible with Linux is ever-expanding. Still, you should consider looking at what hardware is supported by the distribution of Linux you choose. Make sure that you have a compatible ethernet card, for example, as some older PCs don't necessarily have one. I have had good luck with 3Com PCI ethernet cards. For Linux on a Macintosh, again, follow the system requirements as laid out by LinuxPPC, Yellow Dog, SuSE, Debian, or whichever distribution you choose.

First off, you'll have to make a few decisions. Do you intend to keep Windows on that PC or are you fine with erasing that hard drive? If your PC has a small drive to begin with, you might consider buying a large drive and using that instead - after all, we are talking about creating a file server.

Second, which Linux distribution will you use? This is the topic of many a flamewar. I don't intend to start one here, but will recommend a few. Red Hat is an ever popular robust distribution of Linux. Make sure you use a version where the point release is greater than zero (7.1, for instance.) You might also choose to use Mandrake, a distribution with many similarities to Red Hat, with a focus on ease of use and configuration.

These distributions, when used with a default install, can fill over a gigabyte of disk space. If you don't need a graphical interface and don't need a Web server, you can likely select an install option that will require less disk space. While Linux can be made to fit on a bootable floppy drive, I don't recommend that you, as a new user, try to select your own packages to pare the installation size.

While the focus of this article isn't teaching you to install Linux, there are five things you may want to consider and prepare for before installing:

1) What drive will you install Linux onto?

Remember, we're using this box as a file server, so you may want to use a larger hard drive. Linux has several folders that it requires for a working system. These folders can also be created as partitions. Linux doesn't really care either way. In any case, your shared files will all be stored in subdirectories under the /home volume. If you go with partitioning options besides making the drive one large partition, or letting the installer automatically create the partitions, make the /home volume as large as you can. Having /home be a separate partition is a smart plan.

2) What sort of installation type should you install?

Server, workstation, graphics manipulation, multimedia, and other classes of installation are available to you. Unless you have a greater plan about how you'll use Linux beyond file sharing, workstation is likely to be fine. If it's not, you can always install other components later.

3) Set the root password and create user accounts and passwords.

The Root user
is king of the
Linux system

The Root user is king of the Linux system you're installing. Root is all-powerful, and has access to every file on the system and every configuration. With great power comes great responsibility, for a slip-up as Root can seriously disable the Linux system. (Not to fear, if you can still get the system to boot as root, you can almost always fix the system.)

You must set the password for the Root user, but you should create user accounts as well. If you log into a lesser privileged user account for everyday use, you eliminate 99% percent of the opportunities to screw up your system. You will need to create user accounts for every user that requires a private file share on the Linux box. You may create them during the installation of Linux or once you have a working system up and running.

4) Set ethernet configuration.

You can use DHCP, BootP, or set a static IP address at this time. There are configuration tools for changing it later, but it's easiest to set it right at this time. This way, when you boot into the system for the first time, networking is already configured and ready to go.

5) Configure Xwindows, video card, and monitor type.

Xwindows is the one of the systems that allows Unix and Linux to have a graphical user interface. When shipped with Linux, it can also be referred to as XFree86. The installer may probe and recognize your video card, but it will not be able to detect your monitor settings. If you find your monitor in a list that Linux knows, that's great. If it doesn't you'll need to find that paper booklet that came with your monitor and told you what your horizontal and vertical sync ranges are. Sometimes these can be gotten from the website of the monitor's manufacturer.

Boot into Linux. Login with your user account. Get familiar with the system, and explore a little. find an application called the Terminal, also known as a shell, Xterm, console, or Konsole. The Terminal is daunting to look at, especially for long time Mac users. If you have any experience typing in a MS-DOS window, this shouldn't be too painful to use. If you want more information on using the Terminal, Apple has a page that's intended for folks using Mac OS X and Web serving, but they discuss common commands in the Terminal. We'll come back to using the Terminal in a moment.

Test your network connection by opening a browser and surfing the Web for a moment. You should have a link to Netscape on the desktop or on the taskbar. You'll be asked to accept a license agreement, and then the browser will open.

If your network connection works, and you've sufficiently played around in Linux and are ready to get down to business, logout and log back in as the Root user.

Download

Download the Netatalk package from SourceForge. This website lists all of the versions of Netatalk for different platforms as well as beta and stable releases. You'll want to download a current release for Linux.

It is important that you look at the suffix of the download you choose. You want to get a .RPM. RPMs are Red Hat Package Manager packages that install and upgrade easily. Many people refuse to use RPMs in favor of downloading the source code in .tar.gz format, but as a new user, I won't ask you to go through the extra steps.

Look at the text within the download. You'll see that some of the files have RH7 in their names. These are appropriate for Red Hat 7.x installations of Linux. The downloads that have MDK in their filename are meant for Mandrake systems. Save this file to your /usr/local/src directory. When Netscape asks for the location you'd like to save this file in, make certain that the field for the file name contains /usr/local/src/netatalk-1.5pre6-1mdk.i586.rpm where the latter part is the name of the file you intend to download for your system.

In your terminal, you'll need to change directories from the /root directory, to the /usr/local/src directory. Do this by typing cd /local/src and pressing Enter.

Install the Netatalk package In your terminal window, type rpm -Uvh netatalk-1.5pre6-1mdk.i586.rpm, where the filename is the same as the one you've downloaded. The Red Hat Linux 7.0 Reference Manual, includes some chapters on using rpm, and using Gnorpm. Gnorpm is a graphical method of installing, upgrading, and managing RPM packages. We're using the manual method from the Terminal simply because I can't predict that you have Gnorpm installed on your system, or where you might click to invoke it, as different distributions set up the graphical environments differently.

Reboot

In your terminal, you may type either reboot, or shutdown -r now, and the system will restart. Login as the root user this time. Don't make a habit of logging in as root, but for the next step, you'll need to. For most tasks in Linux, you don't have to reboot, but since this Apple file sharing is a service that comes up at boot time, I'll want you to reboot. There are ways to restart the services that run at boot time without needing to reboot, but for simplicity's sake, we'll restart the computer.

Test install in Chooser

On your Linux box, open a Terminal, and type ifconfig. If you look at the section that is headed by eth0, you will find the IP address of your Linux machine.

for example, ifconfig on my computer shows this:

root@eliot:/home/vmarks > ifconfig

lo

Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:642 errors:0 dropped:0 overruns:0 frame:0
TX packets:642 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

eth0

Link encap:10/100 Mbps Ethernet HWaddr 00:20:35:29:36:0A
inet addr:192.168.1.101 Bcast:9.37.63.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:2000 Metric:1
RX packets:269619004 errors:10 dropped:0 overruns:0 frame:0
TX packets:207244 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:11 Base address:0x7800

Where inet addr:192.168.1.101 is the IP address that is bound to your ethernet card.

On your Macintosh, open the Chooser and select AppleShare. You'll be asked to enter an IP address, username, and password. Enter the IP of the Linux box along with a username and password that is valid on the Linux box. A mapped file share will appear on the desktop, and will open directly to the home directory of the user who was authenticated in Chooser.

Add users as necessary

Anyone who desires a private share on the Linux box must have a username and password on the Linux box. All user directories are stored under /home/.

First, you must know how to become Root from being logged in as a regular user. You may either log out and log back in as Root, or you may use the su command from the terminal. You will be asked for Root's password and then may be given the # mark as a prompt. Regular users have $ for a prompt. (Some terminals have settings that ignore this convention. Those terminals tend to put the user name in the prompt, as in root@eliot:/home/vmarks > where my user name is root on the machine named eliot and I'm in the /home/vmarks/ directory. ) When you are done acting as Root, type exit and press enter. You will be returned to your lesser-privileged user status.

From a terminal window as root issue the following commands:

# /usr/sbin/adduser (username) where username is the name of your new user.
# /usr/bin/passwd (username)

and type in a new password for the new user. By default the user will have a new group with the same name as the user.

Gil Becerra writes: This will work, but it will not create a home directory for that user. You should issue the adduser -m (username): this will create the user and create a home directory for him at the same time. Also, if you wanted to add them to a group, the adduser -m -G (groupname) (username) is all you need.

For normal production use

If you've had a chance to use Mac OS X, you'll notice that the user you create at install time is an Administrator. The Administrator user is endowed with great privileges, but is not Root. Root is more powerful than any other user, period.

I highly recommend that you log into your system with an underprivileged user account in a production environment, whether you're using Mac OS X or Linux, instead of these more powerful accounts. This will minimize any damage to the system should it get hacked someday, and it will minimize the amount of damage you or someone else can do through ignorance or carelessness.

Only log in as an Administrator or Root when it is absolutely necessary.

Join us on Facebook, follow us on Twitter or Google+, or subscribe to our RSS news feed

Today's Links

Recent Content

About LEM Support Usage Privacy Contact

Follow Low End Mac on Twitter
Join Low End Mac on Facebook

Page not found | Low End Mac

Well this is somewhat embarrassing, isn’t it?

It seems we can’t find what you’re looking for. Perhaps searching, or one of the links below, can help.

Most Used Categories

Archives

Try looking in the monthly archives. :)

Page not found | Low End Mac

Well this is somewhat embarrassing, isn’t it?

It seems we can’t find what you’re looking for. Perhaps searching, or one of the links below, can help.

Most Used Categories

Archives

Try looking in the monthly archives. :)

Favorite Sites

MacSurfer
Cult of Mac
Shrine of Apple
MacInTouch
MyAppleMenu
InfoMac
The Mac Observer
Accelerate Your Mac
RetroMacCast
The Vintage Mac Museum
Deal Brothers
DealMac
Mac2Sell
Mac Driver Museum
JAG's House
System 6 Heaven
System 7 Today
the pickle's Low-End Mac FAQ

Affiliates

Amazon.com
The iTunes Store
PC Connection Express
Macgo Blu-ray Player
Parallels Desktop for Mac
eBay

Low End Mac's Amazon.com store

Advertise

Well this is somewhat embarrassing, isn’t it?

It seems we can’t find what you’re looking for. Perhaps searching, or one of the links below, can help.

Most Used Categories

Archives

Try looking in the monthly archives. :)

at BackBeat Media (646-546-5194). This number is for advertising only.

Open Link