LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2014, 06:35 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 672

Rep: Reputation: 46
Question Need to create a new user


Hey LQ,

I need to permit a graphic designer to access a specific directory with read and write privileges to /var/www/html/subdomains/design.

Is there a simple command that will do exactly this?
 
Old 09-19-2014, 06:50 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,358

Rep: Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990
Do you want this user to be able to see the rest of the filesystem? Read and write to it? Is there anything you want to keep private?

If you don't mind that they see and interact with your entire system, then just set up a regular user account and make sure it has read/write access to the necessary directory.

If you don't want them to be able to see/access anything on the system except that one directory, then set up a chroot jail for the user and "mount --bind" the necessary directory into the jail.
 
2 members found this post helpful.
Old 09-19-2014, 06:55 PM   #3
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 672

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by suicidaleggroll View Post
Do you want this user to be able to see the rest of the filesystem? Read and write to it? Is there anything you want to keep private?

If you don't mind that they see and interact with your entire system, then just set up a regular user account and make sure it has read/write access to the necessary directory.

If you don't want them to be able to see/access anything on the system except that one directory, then set up a chroot jail for the user and "mount --bind" the necessary directory into the jail.
I only want them to read and write into the design directory. Being able to see the rest of the filesystem will probably just confuse him. I'm not familiar with chroot jailing at all. Got any links to good tutorials? I'll be googling in the meantime.
 
Old 09-19-2014, 07:05 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,358

Rep: Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990
Look into jailkit. The basic steps are (taken from my notes the last time I set one up):

Code:
tar xaf jailkit-2.17.tar.gz
cd jailkit-2.17
./configure
make
su
make install
cp extra/jailkit /etc/init.d/jailkit
chmod a+x /etc/init.d/jailkit
chkconfig jailkit on
mkdir /home/jail
jk_init -j /home/jail jk_lsh
jk_init -j /home/jail ssh
jk_init -j /home/jail basicshell
groupadd -g 1002 jailed_user
useradd -m -g 1002 -u 1002 jailed_user
passwd jailed_user
jk_jailuser -j /home/jail/ jailed_user
/etc/init.d/jailkit restart
Where "/home/jail" is the location of the jail on my system, and "jailed_user" is the new user that's going to be in the jail. I used UID/GID of 1002 here, but you could use whatever you like.

This will give them access to a basic shell, and if you "mount --bind" the design directory into their home directory in the jail they should have access to those files as well. You may need to "jk_init -j" some more utilities if they need them, such as text editors, etc.

Most of these steps are taken verbatim from their documentation.

Last edited by suicidaleggroll; 09-19-2014 at 07:07 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how create create extreme limited user ss4sgoku Linux - Newbie 5 10-28-2012 02:17 AM
create user without creating user home directory aksharb Linux - Software 1 05-12-2011 05:21 PM
Processes running while we create a new user and the user logs in rahulchandrak Linux From Scratch 3 05-08-2010 12:09 AM
Create user add file with default password and force user to change it? Morgandy Linux - Newbie 3 02-02-2010 06:06 PM
user home dir doesn't create when new user add dev_mohamed Linux - Software 3 01-12-2007 02:08 AM


All times are GMT -5. The time now is 08:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration