Help configuring sudo for multiple file copies


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help configuring sudo for multiple file copies
# 1  
Old 04-01-2010
Help configuring sudo for multiple file copies

Hiya,
I want to allow some users to copy all filenames of a specific filetype, to a limited directory.

3+ users: need to be able to copy(as root) any *.war file to /usr/local/tomcat/current/webapps/

I tried the following...
Code:
dmurphy         huskar=/tmp/who.sh,/bin/cp [A-z]*.war /usr/local/tomcat/current/webapps/[A-z]*

but it didn't work out so well. I keep getting the error below.
Code:
[1650]#[dmurphy@huskar:/usr/local/tomcat/current/webapps]$ sudo cp /stg/dmurphy/blah.war .

Sorry, user dmurphy is not allowed to execute '/bin/cp /stg/dmurphy/blah.war .' as root on huskar.


What am I doing wrong?

Last edited by pludi; 04-02-2010 at 02:20 AM.. Reason: code tags, please...
# 2  
Old 04-02-2010
Going by how I interpret it, I'd say the user is only allowed to copy a file from the current directory to /usr/local/tomcat/current/webapps/, and even that only if the full directory path is used. Eg,
Code:
cp test.war /usr/local/tomcat/current/webapps/test_1

is valid, while
Code:
cp ../test/test.war ../../usr/local/tomcat/current/webapps/

is not.

sudo tries to match the command line as closely as possible, and doesn't care whether or not you're already in that directory, as it won't discern between a directory and a regular option.
# 3  
Old 04-05-2010
hrm.. this didn't seem to work much better.

In this case, I may just use tomcat manager and allow the user access to manage tomcat so he can deploy the war's.

I'll keep playing around and see if I can get it working.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to make multiple copies?

At work I have to create multiple copies of a file all the time. Example: I have a file called Sec30p01.txt I need thirty of these, then I edit one line in each to make 30 different control files. So I end up with Sec30p02.txt, Sec30p03.txt and so on up to 30 Currently I copy the first file... (8 Replies)
Discussion started by: faaslave
8 Replies

2. Shell Programming and Scripting

Print multiple copies page by page using lp command

Hi I have a pdf file that is being generated using the rwrun command in the shell script. I then have the lp command in the shell script to print the same pdf file. Suppose there are 4 pages in the pdf file , I need to print 2 copies of the first page, 2 copies of the second page , then 2... (7 Replies)
Discussion started by: megha2525
7 Replies

3. Homework & Coursework Questions

Script that copies one file to/over another

1. The problem statement, all variables and given/known data: Write a script that asks for 4 arguments, and the 1st and 3rd need to be -i and -o, and the 2nd/4th need to be file names. Technically, it's supposed to be run as: ./Lab_14.sh -i input.txt -o output.txt Depending on how many... (0 Replies)
Discussion started by: SoVi3t
0 Replies

4. UNIX for Dummies Questions & Answers

multiple copies at once

Dear all, Today I spend almost all my day with something I hope any of you can help me with... I'm trying to write a small script (!/bin/sh) to be able to make 900 copies of one file. Can anyone help me with this? I couldn't figure this out (maybe I need to create some sort of loop) and couldn't... (8 Replies)
Discussion started by: marjocello
8 Replies

5. UNIX for Dummies Questions & Answers

Printing Multiple Copies

Has anyone come accross and solved an issue where only 1 copy of a doc prints after you use the -n flag and specify more then 1. My exact syntax is lp -dprintername -n3 documentname enq command does same thing. Both commands show the 3 copies in the queue but only 1 ever prints I am using AIX... (0 Replies)
Discussion started by: capeme
0 Replies

6. Shell Programming and Scripting

Script to print multiple copies of the same file

Hi, this is my first post so I hope I have placed it in the appropriate section! I have created a looping script to print a text file multiple times. The script works great, and it displays the job numbers of all the prints that result from its execution. The trouble is, only the first job... (1 Reply)
Discussion started by: Alpha7
1 Replies

7. AIX

Printing a number of copies of a txt file

Hi, We have an application running on AIX5.3 that generates text files that are sent to be printed using the lp command. The user can specify the number of copies they want printed, but only one copy ever gets printed. I've checked the lp command that is used, and it correctly specifies... (5 Replies)
Discussion started by: stebradshaw
5 Replies

8. AIX

Printing multiple copies via remote queue

Hi all, I have an interesting problem. Using remote queues to print using jetdirect printers I am unable to get a printer to print multiple copies of a print job. command being used: lpr -P -#3 ./test (one copy prints) Also tried: enq -P -C3 ./test (same results) Any ideas? ... (6 Replies)
Discussion started by: Luck
6 Replies

9. UNIX for Advanced & Expert Users

lp not printing multiple copies

I'm trying to print multiple copies of a file on sun solaris 8 with the lp -n command to no avail. No matter what numeric value I supply -n, I still only get 1 copy of the file printed. The command I'm using is 'lp -d SNY_IT5000-2 -n2 file' The printer is an HP Laserjet 4000 with a... (2 Replies)
Discussion started by: hassan2
2 Replies
Login or Register to Ask a Question