Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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
1  
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 at 23:57
    
@caffinatedmonkey, please explain, I don't really understand your question. –  Andrejs Cainikovs Apr 29 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

 
discard

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.