Results 1 to 5 of 5
How would you add a password to a certain program, or set a list of users that are the only ones that can run/own the program? For instance if i ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-03-2005 #1Just Joined!
- Join Date
- Dec 2004
- Posts
- 50
adding a password to a specific program
How would you add a password to a certain program, or set a list of users that are the only ones that can run/own the program? For instance if i wanted only the user "John" to be able to run firefox and keep the user "Bob" from being able to use it. Or promting "Bob" and "John" for a password when they try to run the program. Either one would work, i just don't know how.
- 07-03-2005 #2
For this example there will be three people: Jason, Dan, and Fred
You want Jason and Dan to be able to run mozilla for example.
Firstly create a group mozilla withThen find the executable file that starts mozilla, e.g. /usr/bin/mozilla next make the group of that executable, mozilla withCode:groupadd -f mozilla
next let both the owner and the group be able te execute the file withCode:chgrp mozilla /usr/bin/mozilla
the first 5 gives read and execute permissions to the owner (most likly root), the second 5 gives read and execute rights to anyone in the group 'mozilla'. The last 0 gives no writes to anyone else.Code:chmod 550 /usr/bin/mozilla
Now add Jason and Dan to the mozilla group withandCode:usermod -G mozilla Jason
(or you can add there names to /etc/groups)Code:usermod -G mozilla Dan
Now Jason and Dan con use Mozilla but Fred can't
I hope this helps
dylunio
- 07-04-2005 #3Just Joined!
- Join Date
- Dec 2004
- Posts
- 50
[root@dellgx1 Me]# groupadd -f gaim
bash: groupadd: command not found
ill find the command, if some1 doesnt reply before i do
EDIT: i found it, it was in the sbin
"ln -s /usr/sbin/groupadd /usr/bin/groupadd" to fix
thanks for writing that out for me, musta been alot of work
it worked after i linked some of the commands that were in the sbin
thanks again
- 07-04-2005 #4
I'm glad you have it suttup
- 07-04-2005 #5Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
You shouldn't really link the programs in sbin to bin -- they are in sbin for a reason.
Let me guess that you are switching to root by just running `su', is that right? Next time, try running `su -' (i.e. s u space hyphen). That will put the sbin directories in your PATH envvar, so that you can run programs from them directly.
Alternatively, you can run the program as /usr/sbin/groupadd by typing the entire path explicitly. They don't need to be in a specific directory for you to be able to run them.
I can also add that you can set a password on a group with the `gpasswd' command. That way, if someone not in the mozilla group wants to temporarily be a part of it and he/she knows its password, he/she can use the command `newgrp mozilla' and type in the password to be able to run it.


Reply With Quote
