-1

My client needed sftp server for sharing files, so I created sftp server on a amazon ec2 ubuntu machine and added different users.

Now their need is when user login to sftp server either via winscp or some other client, they should be able to see only their own folders in home directory, the other folders should not be visible to them. Also in their home directories they should not see any files or folder which start with dot(.).

Is this possible? e.g. see screenshot link below, I just want my client to see/access Transcript folder, nothing else. https://i.stack.imgur.com/kEHfW.png

1
  • 1
    Do a web search for "sftp chroot".
    – Jenny D
    Oct 30, 2014 at 9:06

2 Answers 2

1

The display of hidden folders is a client-side issue and not something you can really influence server-side.

Some options:

  • simply remove the hidden folders (when users are only allowed to log in using sftp anyway they're not needed)
  • If your users only need access to the items in the Transcript folder, make use of the sftp chroot feature.

One approach: The 'match' feature in sshd_config allows you to specify rules based on group membership or username.

Match user joe
ChrootDirectory /home/joe/Transcript
ForceCommand /usr/libexec/sftp-server
1
  • "The display of hidden folders is a client-side issue and not something you can really influence server-side." - Generally this is not true. Why you should not be able to filter listing server-side? Though the fact is that the most widespread SFTP server, the OpenSSH, does not allow any kind of filtering. Oct 30, 2014 at 9:41
0

Thanks everyone, finally this link helped me to achieve my task. http://rmtheis.wordpress.com/2011/07/03/setting-up-an-sftp-site-on-amazon-web-services-ec2-creating-an-account-to-share-with-a-third-party-and-restricting-that-account-to-allow-only-sftp/

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