4

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?

2 Answers 2

3

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.

2

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.

3
  • 2
    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, 2012 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.
    – 0xcaff
    Apr 28, 2014 at 23:57
  • @caffinatedmonkey, please explain, I don't really understand your question. Apr 29, 2014 at 8:12

You must log in to answer this question.

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