Networks in Action
Serving Files Using FTP in Mac OS X
Introduction
File Transfer Protocol, or FTP for short, is an IP-based method of moving files from one computer to another. “IP-based” means that it uses the same underlying communication methods as the Internet, so if your computer can connect to the Net, it can use FTP to transfer files.
In the past, FTP relied on separate client and server programs. You’d set up an FTP server on the computer that had files to share, then use an FTP client program on the computer that wanted to access said files. Mac OS X integrates the FTP server into the operating system, making it easy to share your files without needing a separate server. I previously wrote an article about sharing files between Macs and PCs via FTP that used a server on the PC and a client on the Mac (Basic FTP File Sharing Between Macs and PCs from ATPM 7.11). This article switches places, as Mac OS X serves files to Windows via the built-in FTP server.
Step One: Hardware Hookup
My own network consists of a Mac Cube and a Windows 2000 laptop. The two computers share a DHCP router, which provides Internet access and enables the two computers to “talk” to each other over the network.
If I didn’t have a router or existing network, I’d connect the laptop to the Mac using a crossover cable. Crossover cables create a network for two (and only two) computers. Connect each end of the crossover cable to the computers’ Ethernet ports and you’re done with the hardware setup. Find a crossover cable in the network section of your favorite (in a pinch, your second favorite) computer store.
Two-Computer Crossover Connection
Step Two: Check Your IP Address
Open the System Preferences application and select Network from the View menu or toolbar. This displays your active network connection (you could have more than one). Select Built-in Ethernet from the Show pop-up menu and note your IP address (192.168.123.160, in my case). We’ll use it later to make the FTP client connection.
Checking your IP address in the network view.
If you don’t have an IP address in the Network window, change the Configure pop-up menu to Manually and enter an address like 192.168.1.1. You can use any group of four numbers from 0 to 255 separated by periods, but the 192.168 prefix is reserved for private networks. Then enter a subnet mask of 255.255.255.0.
Step Three: Start the Mac OS X FTP Server
In the System Preferences application, select Sharing from the View menu. Check the “Allow FTP access” checkbox and confirm that your IP address appears in the “IP address” field.
Your Mac now shares the files in your home folder. To examine this directory, select Finder from the Dock, open your startup disk, and open the Users folder. The folder named after your user name is your home folder. When you log into the FTP server using your user name and password, you’ll see the files in that folder.
Start the Mac OS X FTP server.
Contents of my home directory
Step Four: Check the Laptop’s IP Address
Configuring the Windows laptop (mine runs Windows 2000) is similar to the Mac. To check its IP address, click the Start Button > Settings > Networks option, then open “Local Area Connection.” Select Properties, then select the TCP/IP protocol and select Properties again. This displays your IP address.
If you obtain your IP address automatically (my router uses DHCP, which handles the address automatically), you don’t need to do anything. You can assign an address manually as described for the Mac, just make sure the IP address is different (192.168.1.2, for example). The subnet mask is the same, 255.255.255.0. Choose OK to close the Properties windows.
Step Five: Access Your Shared Files
Since the Mac is our FTP server, we’ll access the files from the Windows laptop. Open Internet Explorer (which includes an FTP client) and enter this in the Address field:
ftp://[user name]:[password]@[Mac IP address]
The user name is your full Mac login name, including any spaces. Follow it with a colon and your login password, then the @ sign and your Mac’s IP address. This logs in to the Mac’s FTP server and you’ll see the following window.
FTP via Internet Explorer
The list of folders and files matches your home directory, except that you also see files like “.Trash” and “.DS_Store,” which are invisible on the Mac. Ignore these files, or at least don’t delete them.
Transfer files to or from the Mac by dragging and dropping them in the Internet Explorer window. Once you have the FTP connection, moving files between computers is just like moving them around the same computer. When you’re finished, close the window to log out of the FTP server.
Conclusion
An integrated FTP server is another bonus from Mac OS X’s bag of tricks. FTP makes file transfer easy for users of mixed platforms, like Macs, Windows PCs, or any other Internet-friendly operating system. FTP doesn’t overcome the file format differences, but people who work with platform-neutral formats like text and images or have the appropriate file translators should find FTP a very convenient way to move files around.
Also in This Series
- Mac to Windows: Troubleshooting the “No Logon Servers Available” File Sharing Error · October 2004
- Using WEP Security on an AirPort Network · July 2004
- Whatever happened to…Threemacs.com? · September 2003
- Clandestine Wireless Networking and MacStumbler · July 2003
- Learning to Share With Others: Sharing Preferences Overview · April 2003
- Serving Files Using FTP in Mac OS X · December 2002
- Switching Between Networks in Mac OS X · November 2002
- The Audio/Video Quadras (660av, 840av) · September 2002
- Thoughts on Apple’s Xserve · July 2002
- Complete Archive
Reader Comments (26)
Two problems:
We use Windows in other languages. I tried uploading file names written in Korean but got errors (from Win 98 Korean). Files with English (Roman characters) names worked fine (from Win 98 Korean). Is the problem with Windows or OS X? Does anyone have any ideas on a solution?
I can't upload via Explorer from Mac OS 9 or Mac OS X. Is there a general problem with this? Is there a browser that can?
True, Macs can share via file sharing, but most users here are complete novices and having to teach them two ways to share files is too hard.
We are using 10.1.5 and Win 98 Korean Second Edition.
Thanks,
DanK
But the article points to a unfortunate deficiency in Mac OS X that needs repair. While the underlying Unix system supports FTP transfers (and more secure SSH/SCP transfers as well) so you can upload files using the command line (or even a browser), the Finder doesn't provide a GUI equivalent. If you mount a remote FTP volume in the Finder, it will be read-only. It shouldn't be necessary to use third party software to get a GUI for this very fundamental aspect of computing. Apple should phase out Appleshare and use FTP/SCP in its place, if it is really committed to internet standards (IMHO).
Thanks
Andrew Peace
Just remember that the built-in FTP server only permits connecting as an existing user on that OS X machine, which also means that you have the same access to the hard drive as you would if you logged into the machine while sitting at it normally. If you want to create a permissions-based server with limited access, you would have to use a third-party utility.
Also, many people still don't realize that the FTP protocol is not secure. If someone happened to be watching your internet traffic at your location, they would be able to ascertain the password you used if they knew what they were doing. This can be combated with Secure FTP (SFTP) and rlogin protocols instead of standard FTP.
This article has been very helpful, but can you offer further instructions in regards to Andrew's last post? The Mac I'm trying to remotely log into is a server on a network that connects through an airport. What do I have to do differently to access this machine?
Thanks.
Thank you
Gim
So the path to a mounted volume is:
/Volumes/name-of-drive/
I'm also looking for the solution to this issue.
Keep in mind that user may have to have administrative rights to navigate outside of their home folder—I'm not perfectly clear on that—but if the user can access the entire hard drive locally, then they can access the entire hard drive when connected via FTP.
On the mac i have disabled the firewall incase this was the problem, have checked that FTP is enabled which it is. I know the mac username/password combination I am using is correct becuase I can log into the mac locally with it.
Any suggestions welcome.
Thanks
I am trying to set up a site in my sites folder in the HOME part of the hard drive utilising the apache server software built in.
I am however trying to build and impliment the site remotely so deem it necessary to load the files into the sites folder using ftp.
How do I access this folder from my work computer (xp) and transfer and test the new site, I have enabled ftp in the settings.
Simon
You'll need to open service ports 20-21 in your wireless router and direct them to the local IP address your PowerBook is using. You've already indicated you've enabled FTP on your PowerBook, so just make sure the ports are open to allow the outside connection.
Then, from your work computer, launch your FTP program and connect to the external IP address your internet provider assigned to you at home. You can determine this by opening a web browser from home and opening www.ipchicken.com
When you connect from work, use the same username and password for the FTP login as you use when you log in at home. Once connected, you'll have similar access/permissions to the hard drive as you do when you are local.
Username and password, this is a tad confusing as I cannot fathom where I would have created this as I don't log in using ftp at home???
Simon
It seems that Volumes doesn't necessarily allow you to move up levels as some are contending (JA), but instead allows you to see what network and other mounts there are on the system. More like a hidden file that unless you know the name, wouldn't be able to access.
The Volume I was after was a second hard drive with all my files on it. This tidbit of information allowed me to set up the FTP to access it just fine.
Thanks!
If you navigate up one level from your home folder, you'd be in the /Users folder. One more still and you're at the computer's root, in which you'd see the /Volumes directory.
Thanks in advance for any advice, instructions.
But, if you're setting up a true FTP daemon/server, then you can configure anywhere you wish to be the root directory and only give access there.
Thanks a lot, keep up the good work!
Add A Comment