FTP Server missing in OS X Lion, but you can enable it anyway

If you’ve visited the Sharing Preference panel since upgrading to Mac OS X 10.7 you may have noticed there is no longer the option to enable an FTP server to share files and folders. It’s unclear why Apple pulled the easy frontend to FTP sharing, but if you still want to run a local FTP server (or SFTP) in Mac OS X you can with the help of the command line.

Start the FTP Server in OS X 10.7

  • Launch the Terminal (/Applications/Utilities) and enter the following command to start the FTP server:
  • sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

  • Confirm the FTP server works by typing:
  • ftp localhost

If you see the familiar FTP login:

$ ftp localhost
Trying ::1…
Connected to localhost.
220 ::1 FTP server (tnftpd 20100324+GSSAPI) ready.
Name (localhost:Paul):

You know the server is running. If you don’t see that, then the server either hasn’t finished starting yet or you didn’t enter the command properly. You can then FTP from other Macs via the same ftp command, or by using the “Connect to Server” option in the Finder.

Enabling the SFTP Server in OS X 10.7

As you probably know, FTP is unencrypted and as a result as fallen out of favor for security reasons. Enabling SFTP is one easy extra step.

  • Complete the steps above to start the standard FTP server, then launch System Preferences and go to “Sharing”
  • Click on the checkbox next to “Remote Login” to enable SSH (and SFTP)

Enable SFTP Server in Mac OS X Lion

You can verify that SFTP is working by typing this at the command line:
sftp localhost

Note: Despite enabling SFTP, the standard FTP server will continue to run as well.

Disable FTP Server in OS X Lion

Here’s how to disable the server:
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist

As the command suggests, this unloads the ftp daemon and shuts down the server. Obviously you can only shut down and disable the FTP server if it was enabled to begin with.

This is an elaboration on a tip from Land of Danielvia TUAW, who goes on to explain how to get ftpd to launch automatically on reboot, so if you’re interested in that, don’t miss their post.


Via http://feedproxy.google.com/~r/osxdaily/~3/38PMBiMvR_g/

Related Posts with Thumbnails
 

Comments are closed.

WordPress Blog