0

I want to have user with access to only one folder.

I followed unix.stackexchange question, badr answer, I am able to create a user with access to only one folder. It is working fine. The user is able to create / transfer files. I am able to connect with WinSCP.

added below content at the bottom of /etc/ssh/sshd_config

Match Group exchangefiles
  # Force the connection to use SFTP and chroot to the required directory.
  ForceCommand internal-sftp
  ChrootDirectory /var/www/GroupFolder/
  # Disable tunneling, authentication agent, TCP and X11 forwarding.
  PermitTunnel no
  AllowAgentForwarding no
  AllowTcpForwarding no
  X11Forwarding no

When I try to login with Putty, Putty console is automatically closed.

I want to give below permission to user,

Need to login with Putty (SSH access - Should not have permission to go out from his directory)
Can able to run Python script / Java files
Can able to access MySql

Any idea on how to proceed on this ?

4
  • ForceCommand prevents using anything except sftp
    – Jakuje
    Dec 20, 2016 at 8:31
  • Did you consider sudo without administrative privileges for what you need?
    – Hastur
    Dec 20, 2016 at 9:20
  • @Hastur Could you please elaborate it ?
    – Muthu
    Dec 20, 2016 at 13:47
  • @Jakuje How to accomplish my scenario ?
    – Muthu
    Dec 20, 2016 at 13:47

1 Answer 1

1

Looking at your wishlist, you probably want to build a jail yourself, rather than using the built-in features of your SSH-server. For example, have a look at this tutorial, so that you have the flexibility of chrooting to a very minimal jail (confined in one folder like you already have), but with the ability to add the executables you want to give this user privileges to, for instance python.

You must log in to answer this question.

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