ChrootDirectory access and privilege problem

  • Posted on November 1, 2014
  • kneAsked by kne

Hi, I cant login sftp if I Chrooted user(abc) to write privileged directory (/home/abc/ but I can login if I Chrooted directory (/home/abc/ is only readable privilege to user(abc) or user group (abcgrp)

I want to give write access for specific chrooted folder (/home/abc/ and with user could login to sftp. How?

thanks for your help.

my sshd_config is:

Match Group abcgrp ChrootDirectory /home/abc/ ForceCommand internal-sftp X11Forwarding no AllowTcpForwarding no

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Take a look at How can I chroot sftp-only SSH users into their homes? - Ask Ubuntu. In order to chroot abc to /home/abc/, you need to have /home/abc/ writable only by root and grant them write privileges to a subdirectory, e.g. /home/abc/

I am guessing that you created the directory as an administrative user and not the user abc?

If so, you need to give the abc user permission to the folder you created as an administrator. Use this command to do that:

chown -R abc:abcgrp /home/abc/