SCPONLY(8)

πŸ“¦
version 4.8 Β· 2 versions
, in arch rolling, nixos 26.05, nixpkgs unstable

πŸ’… scponly(8) β€” the manual page, but make it make sense

okay bestie, welcome to scponly(8). yes that's the whole title. it's a section-8 sysadmin page and it's lowkey iconic, let's go 🫢


🌸 NAME 🌸

scponly β€” a very limited shell made for secure file transfers, that's the whole vibe ✨


πŸŽ€ SYNOPSIS πŸŽ€

scponly

that's literally it. no flags, no args, no drama. main character entry, zero notes πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you're a sysadmin and you want to let remote users read and write local files, but you do not want to hand them remote execution privileges. scponly is that girl. it's an alternative "shell" (and yes, the original page puts "shell" in quotes too, because it's a shell in a trench coat) for exactly this situation. functionally, the cleanest way to describe it is: it's a wrapper around the trusted suite of ssh applications. that's it, that's the whole job 🫢

the classic scponly usage is making a semi-public account β€” think of it like the whole "anonymous login" concept for ftp, but make it ssh. an admin can share files the same way an anonymous ftp setup would, except you get to use all the protection that ssh provides. and ngl this matters, because ftp authentications traverse public networks in a plaintext format. we don't do that here πŸ’€

and it's not just one single anonymous user either β€” scponly supports configuring potentially many users, and each one of those users could be set up to give access to distinct directory trees. obsessed. aside from the installation details, each of these users would have their default shell in /etc/passwd set to "/usr/local/bin/scponly" (or wherever you choose to install it, no pressure). what that means: users with this shell can neither log in interactively nor execute commands remotely. what they can do is scp files in and out, governed by the usual Unixish file permissions. slay 🌈


✨ FEATURES ✨

  • Logging: scponly logs the time, the client IP address, the username, and the actual request β€” all to syslog. receipts, always πŸ§ΎπŸ’–
  • chroot: scponly can chroot to the user's home directory (or any other directory the user has permissions for), disallowing access to the rest of the filesystem. locked in, literally πŸ”’
  • sftp compatibility: the author's own testing of sftp against an scponly user "worked great." this is probably the cleanest and most usable way for an scponly user to access files. we stan a clean interface πŸ¦‹
  • Security checks: root login is disallowed β€” though let's be so fr, root should never be configured to be using scponly as the default shell anyway πŸ™ˆ
  • WinSCP 2.0 compatibility: scponly can be compiled in WinSCP compatibility mode, which will permit a "semi-interactive" shell that WinSCP can use. teamwork πŸ’œ
  • gftp compatibility: scponly is compatible with gftp if you set "use ssh2 sftp subsys" in your gftp options. one little setting, that's it ✨

and a big heads up bestie: scponly doesn't do anything to manage read/write permissions. the ssh applications already do that just fine, no need for a second opinion. if you use scponly, be aware that good old Unix-style file permissions are still doing the work of protecting your files. periodt πŸ‘‘


⭐ NOTES ⭐

  • as recent as June 26, 2002, vulnerabilities have been discovered in OpenSSH. there is also a SSH1 protocol vulnerability. so if you're going to use scponly, be aware it is no more secure than the ssh installation it runs on. like, it's a wrapper, not a suit of armor, y'know? 😭
  • the author has since discovered that ssh.com's commercial ssh offering supports BOTH "dummy users" and functionality paralleling scponly. there are no notes findable on these features, but the author did read that they exist, and will make a point to include more information later. it appears OpenSSH does not yet support these features. at this time the author has no plans to end-of-life scponly, though ultimately β€” and this is real β€” they recognize that scponly should eventually become just a feature of whichever sshd you may run. growth 🌱

πŸ’– FILES πŸ’–

  • /usr/local/bin/scponly β€” the default location for the shell itself. home base 🏠
  • /usr/local/sbin/scponlyc β€” the default location for the chrooted version of scponly. the sequel πŸ”₯
  • /etc/shells β€” to be a proper shell, it has to be included here. no invite, no party πŸ’…

🌈 SEE ALSO 🌈

chroot(2), ssh(1), scp(1), sftp(1), shells(5), sshd(8).


πŸ‘‘ AUTHORS πŸ‘‘

Joe Boyle <joe@sublimation.org>.


πŸ“ LEGALITIES πŸ“

Copyright (C) 2001, 2002, 2003 Joe Boyle <joe@sublimation.org>.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

like yes it's all caps, that's just how lawyers type. read it, it's real 🫢


πŸ’€ BUGS πŸ’€

versions prior to 2.4 have a vulnerability wherein the .ssh/environment file can be used to override the $PATH and $LD_LIBRARY_PATH vars, compromising the shell. so if you're on something ancient, please upgrade, i'm begging 😭


and that's the page!! originally dated Sept 03, 2002, and it's scponly(8) β€” a whole little legend. go forth and scp responsibly πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from