scponly, the Alanis Morissette of FreeBSD ports.

scponly is ironic

iMarc has abandoned the insecure FTP, in favor of SFTP. On our FreeBSD systems, we implement a port called scponly for users to transfer files over SFTP in a chroot'ed environment, without giving them SSH or terminal access.

Even though the port is called scponly, is also supports SFTP. In fact, I've only tested it using SFTP, not scp. Normally, it's very easy to set up.

However, on a new FreeBSD 6.2 server, we ran into some problems. We had one working scponly server (running FreeBSD 5.x) and a broken scponly installation running on the 6.2 server. The broken installation would allow scponly connections, but immediately drop them before transfer. To test, we turned error reporting up to eleven and manually pushed a file to each server using scp.

scp foo.txt user@example.com:incoming/

On both servers this errored out, closing the connection immediately. Using SFTP worked fine on the working server, but scp didn't work on either server. Odd...

After some investigation, Will found out that scponly does NOT support scp by default.

From scponly's wiki:

The new release of scponly-4.2 has:
no support for scp by default...

Excellent! In fact, reading this inspired me to write a program called calculatoronly that does not support numeric calculations by default.

The Fix

Back to our original problem... if you're running FreeBSD 6.2 and setting up scponly chroot'ed users, the port doesn't create all files that the new FreeBSD scp binary requires. I'm sure they'll fix this soon, but in the mean time you can create these files manually:

// run the scponly chroot script as you normally would su cd /usr/local/share/examples/scponly/ && /bin/sh setup_chroot.sh // ... create the account as you normally would // manually make these files if you're on FreeBSD 6.2 // replace /home/USER with the path to the account you just made mkdir /home/USER/dev touch /home/USER/dev/null chmod 0666 /home/USER/dev/null

But, since scponly only supports sftp, don't use it to scp files. Obviously.

Comments

Thursday, Feb 8, 2007 / 4:29pm Will Bond said…

"and, yeah, I really do think"

Thursday, Feb 8, 2007 / 4:51pm Fred LeBlanc said…

This metaphor is a limo.

Thursday, Feb 8, 2007 / 5:42pm Sunflower Seed said…

Fr3d teh p4rty POOP3r

Comments have been turned off on this blog.
Read something more recent.

Statements and opinions expressed in this blog and any comments made are the private opinions of the respective poster, and, as such, iMarc LLC is neither responsible nor liable for such content.

Meet The Author

Dave Tufts

Vice President, Director of Technology

Search

Recent Blog Posts

Recent Comments

We heart Visitors

  • iMarc
  • 14 Inn Street
  • Newburyport, MA 01950
  • Phone: (978) 462-8848
  • Fax: (978) 462-8807
  • Directions

Contact Us

Whether you have a huge project specification or just want to talk about updating your site, we’re here to help. Fill out the form, and we’ll get right back to you.

Contact Us
  • All Fields Required

Close