Script to give a user sudo permissions


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to give a user sudo permissions
# 1  
Old 06-19-2013
Script to give a user sudo permissions

Can some one please let me know a script which gives the user sudo permissions?

Thanks in advance....
# 2  
Old 06-19-2013
Code:
 
sudo bash

# 3  
Old 06-20-2013
Could you also let me know the procedure for writing a script to give sudo permissions for a specific user in linux
# 4  
Old 06-20-2013
The requirement is not clear. sudo permissions can be given at different levels. In most cases you have to modify /etc/sudoers with proper syntax to include the aliases and user details and what they are allowed to do on the system as superuser.

Check man sudoers for details

-Raja
# 5  
Old 06-20-2013
Once you know how to add one sudo user, you can write a script to add others. One might wonder why so many sudo users!

Last edited by DGPickett; 06-20-2013 at 03:06 PM..
# 6  
Old 06-21-2013
the answer what u replied was "sudo bash"

I was asking If i am a super user, if i want to give another user sudo permissions, how should i give...

I have tried adding " username ALL=(ALL) ALL " in "/etc/sudoers " file, but it did not worked.....
# 7  
Old 06-21-2013
"username ALL=(ALL) ALL" syntax is correct. Did you make sure you had a "tab" and not space between username and ALL ?

Also you can check the subsequent entries on the file and see if any of them is overriding your settings.

-Raja
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to give permissions to read write but not delete the file?

i want to give users the ability to create write and read files in other user directory , but not to have option to delete the file after created ( sticky bit not going to work here ... ) for example : i have user : manager with directory repository i have user : worker1 that need to write... (4 Replies)
Discussion started by: umen
4 Replies

2. UNIX for Dummies Questions & Answers

Script without execute permissions will work for a user?

Please help me to understand the issue: Issue: There are shell scripts in a user home directory (/home/user_1) without execute permissions (rw-r--r--) to owner,group and world These shell scripts were able to execute/work previously but its not working now and it says permission denied or... (2 Replies)
Discussion started by: MSK_1990
2 Replies

3. Solaris

How to give sudo access to the personal id's to that of application id in Solaris 10?

Hi, I am using solaris 10. Requirement is I need to give sudo access to the normal id's to the application userid. Example:I have an personal id calle "rzynv5" on the solaris server.I have an application id called "gmdidp".Requirement here is when user logged in as rzynv5 next thing he... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

4. Solaris

How to give sudo entry in .profile file in Solaris?

Hi all, In Solaris , What entry should I add in my .profile file in home directory so that every time I don't have to give Sudo's full path like /usr/local/bin/sudo as well as /usr/sbin/ping and it will be Great help if you could tell me how to know what should be added. Please Advice.... (2 Replies)
Discussion started by: manalisharmabe
2 Replies

5. Shell Programming and Scripting

Interactive script to give user option of what text to add

Hello all, I have created a script that will remove the first two lines of one text file (body.txt) and then add the text from a different text file (header.txt) directly to the beginning of the freshly modified body.txt file. It is as follows: #!/bin/bash ## This script will add a header... (2 Replies)
Discussion started by: marcozd
2 Replies

6. Shell Programming and Scripting

sudo su - user in a shell script

Normally i would google, but I did not know how to google the problem I am facing now also being a newbie in shell scripting. Okay, the requirement is user1 has sudo rule to su - user2(NO PASSWORD) and user2 has will be able to sudo certain commands so following works fine from command prompt... (2 Replies)
Discussion started by: beEnthu
2 Replies

7. UNIX for Dummies Questions & Answers

Possible to give non root user sudo to "crontab -l"

Does anyone know if this is possible? I want to give some users access to root's crontab but only with a read privilege. Is this possible to do or can only root or people with full root sudo view root's cron? (4 Replies)
Discussion started by: LordJezoX
4 Replies

8. Shell Programming and Scripting

How to give permissions to an open file in vi editor?

Hi all, I have a shell script that i started editing, only in the midst of which i tried to save the changes i found that the file wasnt been provided with write/execute permissions. I later have redone the changes and saved the file- Just curious to know if there was any command wherein... (5 Replies)
Discussion started by: Pankajakshan
5 Replies

9. UNIX for Dummies Questions & Answers

Possible to give sudo access to subdirectories?

Say I want to give someone access to /example/directory/* where * equals all the sub directories inside of /example/directory I tried doing something like joe DEV1=(ROOT) /example/directory/ But that doesn't seem to want to work. If I give him the full subdirectory... (3 Replies)
Discussion started by: LordJezo
3 Replies

10. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies
Login or Register to Ask a Question