Hi!
I have the following question..
I'm working on a multiuser OS, that is supposed to separate the rights (permissions). The question is how can I make different users execute different commands? For example user "root" can execute whatever command he wants, but user "guest" can't do that. Any suggestions are welcome..
Thanks.
OS shell..
RE:OS shell..
Well Linux has the permissions that allow read write and execute for owner, group and public users.
A particular program is set to owner root, then the permissions set for only root to execute that particular program.
You could also do the same with the group.
Windows also has a similar pattern, but its not officially native to the OS but through something known as Active Directory, a chunky service.
A particular program is set to owner root, then the permissions set for only root to execute that particular program.
You could also do the same with the group.
Windows also has a similar pattern, but its not officially native to the OS but through something known as Active Directory, a chunky service.
RE:OS shell..
If security and quality aren't of concern you could just put something like this before each and every command...
if (strcmp(u%,"root")==false){
printf("Sorry, only root can do that...\n\r");
else if(strcmp(u%,"root")==true){
command();
u% being the user, defined when he logs in. Again, this system would pose a huge security flaw, but it would be good temporarily until you could figure it out.
if (strcmp(u%,"root")==false){
printf("Sorry, only root can do that...\n\r");
else if(strcmp(u%,"root")==true){
command();
u% being the user, defined when he logs in. Again, this system would pose a huge security flaw, but it would be good temporarily until you could figure it out.