Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to create a new user account, that should have full access to a single dir within the linux HDD, unlike the root user that has access to everything. And this account would be used via SSH for file sharing on the network. How do I get started?

share|improve this question
up vote 2 down vote accepted

Just create a normal user, and set it's home dir to the desired folder:

useradd -d /share username

If you explicitly do not add this user to sudoer's list, or any special groups, then it will be limited by default. For security purposes you might want even to chroot that user.

share|improve this answer
By default users can read quite a lot of files on Ubuntu systems. When I create a new user, everyone has read-only access the home directory by default. So without a chroot configuration it's definitely not secure at all in my opinion. See my answer on how to do that. – gertvdijk Sep 16 '12 at 10:59
Is it possible to create a read only session where the user is not allowed to type but only to view the typing. – caffinatedmonkey Apr 28 '14 at 23:57
@caffinatedmonkey, please explain, I don't really understand your question. – Andrejs Cainikovs Apr 29 '14 at 8:12

File transfer (and sharing) over SSH is done using the sftp protocol usually.

And you can set up OpenSSH to chroot to the user's directory while forcing sftp (no command line allowed) like explained in this how-to.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.