Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you have virtual users using an SFTP server?

Tags:

macos

ssh

sftp

ftp

I've had a FTP server (Mac OS X, but not the server version) set up for a while where the users are virtual, i.e. they are not actual user accounts in the server's OS, but accounts handled by the FTP server software -- to the OS they all look like the ftp user account. I'd like to retire the FTP server software and go SFTP instead.

Is there a way to set up SFTP/SSH so that I can create virtual users and at the same time sandbox them?

The reason I want virtual users is because I add and remove accounts from time to time, and doing that with proper user accounts tend to get messy, and I don't know of a good way to sandbox them. There's always some files left and each user has their own user directory (with a lot of files only relevant if they would actually log on to the machine when sitting in front of it), which is quarantined when the account is removed, so you have to remove it by hand yourself, and so on.

like image 420
Theo Avatar asked Sep 02 '08 09:09

Theo


People also ask

How do I give someone access to SFTP?

At the top of the window, click the icon for Open Connection. In the drop-down menu, select SFTP (SSH File Transfer Protocol). In the Server field, enter the Internet Protocol (IP) address for the server. Enter the username and password that you use to connect to SFTP.

Can I use SFTP without SSH?

SFTP cannot exist without SSH — SFTP uses SSH as the binding agent to transfer files securely. In other words, SSH protocol is used in the file transfer mechanism SFTP. In fact, most SSH servers include SFTP capabilities. However, not all SFTP servers support SSH commands and actions.

What SFTP users?

SFTP (Safe File Transfer Protocol) is part of the SSH protocol designed to securely transfer files between remote systems. It allows users to view, manage, and change file and directory permissions on remote systems.


1 Answers

The usual generic Unix answer to this is 'PAM'. If you want plain old OpenSSH SSHD to handle your SFTP, you need something plugged in to SSHD's PAM stack (/etc/pam.d/sshd) that does what you need and leaves out what you don't need. This might be a general-purpose directory server (probably LDAP) that maps all your virtual users to one home directory and gives them a restricted or scponly kind of shell.

If you want to look at FTP servers that can also do FTP-ssl (which is not the same as SFTP), good ftp servers like Pure-ftpd or vsftp will do that. FTP-ssl servers have simpler virtual user support.

http://www.bsdguides.org/guides/freebsd/networking/pure-ftpd_virtual_users.php

like image 172
robc Avatar answered Sep 28 '22 20:09

robc