0

I'm trying to create a SFTP server using Ubuntu Server 24.04 LTS, and I'm having trouble copying to the folder I created:

  • The sshd_config sets ChRootDirectory to \sftpsrv, which is a mounted disk specifically for SFTP files
  • I am not able to create a folder inside \sftpsrv or assign permissions to a user and send files to that folder; my goal is to have something like:
    \sftpsrv\linux
    \sftpsrv\windows
    \sftpsrv\firewall
    
  • I want only one user, so to copy files to these folders I could use something like this, but after trying the first part, as soon as I try to copy the file, I get permission denied:
    copy sftp://{user}:{password}@{IP}/linux/{filename}
    

Can anyone help me solve this?

Root is the owner of /sftpsrv and sftpuser is the owner of the others folders.

4
  • 1
    What are the permissions and ownership on the /sftpsrv directory (and any subdirectories like /sftpsrv/linux)? Try running "ls -laR" in the /sftpsrv directory, then edit your question to include the output.
    – Kenster
    Commented May 23 at 12:25
  • I edited it now!
    – SIMOES
    Commented May 23 at 14:06
  • what do you get from sudo namei -l /sftpsrv ?
    – hanshenrik
    Commented May 23 at 14:12
  • I get:drwxr-xr-x root root / drwxr-xr-x root root sftpsrv
    – SIMOES
    Commented May 23 at 14:38

1 Answer 1

0

The answer was create a new user, change permission of subfolders to that user and the specific group and it's working now!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .