ghantoos / lshell

lshell is a shell coded in Python, that lets you restrict a user's environment to limited sets of commands, choose to enable/disable any command over SSH (e.g. SCP, SFTP, rsync, etc.), log user's commands, implement timing restriction, and more.
GNU General Public License v3.0
436 stars 112 forks source link

Limited command access to group of users. #100

Closed alankarmore closed 9 years ago

alankarmore commented 9 years ago

I have created one group with the named as "testgroup". First I have added one user to this group say "testuser" , and I have allowed some commands to this group in lshell.conf file as below:

[grp:testgroup] allowed : ['ls','pwd','cd','composer','git','mkdir','chmod'] path : ['/var/www/test', '/usr'] - ['/usr/local'] home_path : '/home'

Now when this user and group is the owner of any directory the chmod command is allowed for "testuser".

Now I have create new user with name as "testuser1" and added to the same group "testgroup" but when I have logged in as testuser1 but for this user "chmod" comamnd is not working.

Actually I want to allow some limited to the group instead of adding it to the specific user. So whoever user is belongs to that group will have access to those specific commands or directories. Any help of suggestions on this are appreciated.

ghantoos commented 9 years ago

Hi,

I am unable to reproduce your bug. What version of lshell are you using? Could you please send the output of getent group testgroup ?

Here is my test here, using your configuration.

mazzika:~# getent group testgroup
testgroup:x:1006:test1,test2
mazzika:~# su - test1
You are in a limited shell.
Type '?' or 'help' to get the list of allowed commands
test1:~$ chmod
chmod: missing operand
Try 'chmod --help' for more information.
mazzika:~# su - test2
You are in a limited shell.
Type '?' or 'help' to get the list of allowed commands
test2:~$ chmod
chmod: missing operand
Try 'chmod --help' for more information.
test2:~$ pwd
/home
test2:~$
mazzika:~# su - test1
You are in a limited shell.
Type '?' or 'help' to get the list of allowed commands
test1:~$ pwd
/home