• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Best way to add sftp user to be jailed within an existing host

Paul Larson

Basic Pleskian
Server operating system version
Ubuntu 22.04.4 LTS
Plesk version and microupdate number
Obsidian Version 18.0.62 Update #2, last updated on July 29, 2024 11:19 PM
There are numerous threads that cover this issue, many I've read, but I can't seem to master this workflow.

  • A domain exists, example.com, with user: example
  • A directory exists, /var/www/vhosts/example.com/upload
  • I'd like an sftp user (not ftp) jailed to /var/www/vhosts/example.com/upload
FTP is not an option for the client. FTP or over TLS not an option.

I've solved this in the past, but always felt I'm over-working something. My norm has been:

  • Create completely separate ssh user (as root user, not in Plesk)
  • Create group (usermod command), such as my-group, where 'example' and 'additional_user' are members
  • Set directory ownership of /var/www/vhost/example.com/upload to example:my-group
  • Then, the ssh user additonal_user can navigate to this 'upload' directory and upload files - but they can also navigate the rest of the web property
Paul
 
I can't really think of any another way than what you've described already. Which is not to say there isn't any other way to accomplice, but to me your approche makes sense :)
 
I'm trying to search a solution for this and found this article: Plesk: Enable SFTP access for additional FTP users. Works but the user is not properly jailed, maybe you can take a look and if you can fix it can let me know as well :)
Hey,

I'm trying to follow these instructions, but the final section where you edit:

`nano /var/www/vhosts/domain.tld/etc/passwd`

this file doesnt exist (obviously using the correct domain.tld) and if I try and create it, then it says I cannot save the file?

Any ideas?
 
Back
Top