Visit The New, Modern Unix Linux Community


unix scripts


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers unix scripts
# 1  
unix scripts

Hi all
Can sombody tell me how can i run a script as a regular user and then change in the middle of the script to root,perform a task that needs root permisions and get back to the regular user.
# 2  
Switching to Root in a script

Hi there

I had a call the other day where a User wanted to do the same thing..

We and a couple of others came to the decision that Under TRU64 , you cannot do that.

How ever try looking at sudo

Here is a brief description

Sudo (superuser do) allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root or another user while logging the commands and arguments.

or have a look at the man page on DOP

dop - Allows a user to execute a privileged program without knowing the root password. The dop command also modifies the action database.

Hope this Helps
# 3  
Hi Burts.

I will appreciate it a lot if you can send me an example for a script.

Thanks again
Smilie
# 4  
SUDO & DOP

I dont have any examples but

Have a look at this website and talk to you Administrator

http://www.courtesan.com/sudo/


Regards

Mr B
# 5  
Java Performing root operations while another user...

Here's an alternative that I was shown a few months ago for a task I had ...

su root -c "cp -R /usr/users/$cur_user/unixcourse /usr/users/$recv_user && chown -R $recv_user /usr/users/$recv_user/unixcourse"

Also: You need to be a member of the system group to be allowed to "su" to root.

Cheers,
Cameron
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #666
Difficulty: Medium
IEEE 802.3 is a working group and a collection of Institute of Electrical and Electronics Engineers (IEEE) standards produced by the working group defining the physical layer and data link layer's media access control (MAC) of wireless Ethernet.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX commands and scripts

Hi guys, Hoping someone can help with the below - involves basic commands and some scripting. Thanks so much in advance for your amazing time and help. 3. The file /etc/profile contains the default initialization options for your shell. Produce a unique list of all variables with uppercase... (1 Reply)
Discussion started by: edujs7
1 Replies

2. Shell Programming and Scripting

Unix scripts

hi everyone.Can anyone tell what books to study for unix shell scripting.ive planned to learn unix scripting but i dont kno what kind of books to refer so do help me..Thanks in advance. (1 Reply)
Discussion started by: madanmeer
1 Replies

3. UNIX for Advanced & Expert Users

Unix/ Shell scripts

Hi, I need to develop a function incrementor that increments a given number that is passed as an argument (this should use eval). so, am not able to get much info on eval by googling (perticularly on incrementing). please if any one can help me out. thanks in advance (4 Replies)
Discussion started by: geervani
4 Replies

4. Shell Programming and Scripting

Unix programming scripts.

How can I replace "?" with the appropriate information. (7 Replies)
Discussion started by: ejuste
7 Replies

5. Shell Programming and Scripting

Unix Scripts

Hi, I have to write 2 unix scripts: 1. Check whether the databases are up or down which are on different servers. 2. Check the file system space on different Unix servers. Please share your model scripts here. I have to submit this ASAP. Appreciate your reply...... Thanks (4 Replies)
Discussion started by: dreams5617
4 Replies

6. UNIX for Advanced & Expert Users

Unix Scripts

Hi, I have to write 2 unix scripts: 1. Check whether the databases are up or down which are on different servers. 2. Check the file system space on different Unix servers. Please share your model scripts here. I have to submit this ASAP. Appreciate your reply...... Thanks (1 Reply)
Discussion started by: dreams5617
1 Replies

7. Shell Programming and Scripting

UNIX scripts for router

Hi, I want to write a script in unix for my routers which will collect the output to a file.. how do i do that? thanks in advance (3 Replies)
Discussion started by: pasandhu
3 Replies

8. UNIX for Advanced & Expert Users

Porting of Windows written unix scripts to unix platform

Can anybody help me in finding out a solution for the problem below? When we write .unix or .sh files in windows OS and port them to Unix platforms there is a character ^M inserted at the end of each line of the script file. During ftp porting I set the transfer mode as ASCII for the script... (7 Replies)
Discussion started by: tamilselvi
7 Replies

9. UNIX for Advanced & Expert Users

vi scripts on UNIX

Hi there I'm hoping one of the expert unix guys or gals can assist me in understanding the language within scripts e.g clear while true do tput cup 0 0 LIST=`grep cisco /etc/hosts|grep -v _int | awk '{print $2}'` for SITE in $LIST do IP=`grep "$SITE"... (4 Replies)
Discussion started by: nemex
4 Replies

10. UNIX for Dummies Questions & Answers

UNIX Scripts

I need to find a place or places on the Internet where I can find UNIX scripts to view and to modify to make life easy on the UNIX environment. Shell scripts to be used, ksh, sh, csh. Can someone help me on this. Thanks ;) (2 Replies)
Discussion started by: wolf
2 Replies

Featured Tech Videos