how to fix user access only E drive using SFTP in windows server with Filezila

Tamil selvan M 85 Reputation points
2024-01-12T10:13:57.22+00:00

we setup the  SFTP inside the VM and we tried to connect with File Zila, it can able to connect to the server. We've granted permission to the SFTP user to exclusively access the E drive. However, when attempting to connect using FileZilla, an error occurred, and despite our multiple attempts to resolve it promptly, i am trying in windows machine not the linux machine and c drive i can able to access but i can't able to access E drive.. image

please give me a steps to create the users and give the permisioon for only access E drive, i tried multipe ways but i can't figure out.

Windows for business Windows Client for IT Pros Directory services Active Directory
Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MotoX80 36,291 Reputation points
    2024-01-12T15:53:13.72+00:00

    I am assuming that you only want to allow sftpuser to access sftp and have no need for other access like allowing adminstrators SSH access.

    Modify C:\ProgramData\ssh\sshd_config and verify that you have these statements.

    Allow password authentication.

    # To disable tunneled clear text passwords, change to no here!
    PasswordAuthentication yes
    

    Allow the user to log in.

    # Authentication:
    Allowusers sftpuser 
    

    Enable sftp and force it to the E drive. .

    # override default of no subsystems
    Subsystem	sftp	sftp-server.exe -d e:/
    

    Define the user and set his root folder.

    Match user sftpuser
       ChrootDirectory e:/
    

    Verify that the NTFS permissions on the E drive allow access to the user. Personally, I would use E:\Data or some other folder and not the entire drive.

    Recycle the OpenSSH Server service to implement any config changes.

    See: https://superuser.com/questions/1549527/how-do-i-restrict-users-to-sftp-in-openssh-on-windows-server https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.