LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2014, 01:01 AM   #1
zak100
Member
 
Registered: Jul 2009
Posts: 262

Rep: Reputation: 2
Giving Access to /var/www/cgi-bin without typing root password


Hi,
I am teaching CGI programming. Students have to copy CGI scripts in /var/www/cgi-bin. This requires root access. Kindly guide me with some technique so that students do not have to type root password.

Zulfi.
 
Old 09-16-2014, 01:57 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Here are two articles that might have useful information:

http://www.linuxquestions.org/questi...script-345936/

http://how-to.linuxcareer.com/simple...n-ubuntu-linux
 
Old 09-16-2014, 02:51 AM   #3
osucowboy0510
LQ Newbie
 
Registered: Aug 2014
Distribution: CentOS 7
Posts: 11

Rep: Reputation: Disabled
try to set acl on the folder on the username(s) they use so they can copy without a problem hth

setfacl -m u:<uname>:rw /var/www/cgi-bin
 
Old 09-17-2014, 04:53 AM   #4
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
Thanks for your response. I tried your command, it executes but still i am not able to copy as lab6. Again it copying only for root. I am using Fedora 20.
Code:
[root@localhost httpprg]# setfacl -m u:lab6:rw /var/www/cgi-bin
[root@localhost httpprg]# exit
exit
[lab6@localhost ~]$ pwd
/home/lab6
[lab6@localhost ~]$ cd Sir
[lab6@localhost Sir]$ ped
bash: ped: command not found...
[lab6@localhost Sir]$ ls
dbprg  hello.cgi  hello.pl  Hello.pm  httpprg  hw_client.pl  soap2.pl
[lab6@localhost Sir]$ cd httpprg
[lab6@localhost httpprg]$ ls
first.pl  second.pl
[lab6@localhost httpprg]$ cp second.pl /var/www/cgi-bin
cp: cannot stat ‘/var/www/cgi-bin/second.pl’: Permission denied
[lab6@localhost httpprg]$ who am i
lab6     pts/0        2014-09-17 05:38 (:0)
[lab6@localhost httpprg]$ ls
first.pl  second.pl
[lab6@localhost httpprg]$ cp second.pl /var/www/cgi-bin
cp: cannot stat ‘/var/www/cgi-bin/second.pl’: Permission denied
[lab6@localhost httpprg]$ su
Password: 
[root@localhost httpprg]# cp second.pl /var/www/cgi-bin
[root@localhost httpprg]#
Please guide me.

Zulfi.
 
Old 09-17-2014, 09:20 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Try "setfacl -m u:lab6:rwx /var/www/cgi-bin" instead.

You need the "x" on directories to be able to search them.

You might actually have a better way that prevents users from clobbering each other: http://httpd.apache.org/docs/current...blic_html.html

This way each user has their own "cgi-bin" directory to work with, and allows them to use the same cgi file name...
 
Old 09-18-2014, 12:27 AM   #6
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
Thanks for helping me. This problem is solved. However i would try the information provided for creating individual based cgi-bin directories which can be accessed by same cgi-bin name.

Zulfi.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Standard location for cgi-bin/www files gnashley Slackware 2 05-27-2008 06:52 AM
Permissions of web server folders(cgi-bin, var/www/html) niner710 Linux - Newbie 14 05-14-2008 10:54 AM
gcc cant run in www/cgi-bin g-mey Linux - Server 2 09-05-2006 03:27 AM
c program cant run in www/cgi-bin g-mey Linux - Software 1 09-05-2006 02:46 AM
http://www.burstnet.com/cgi-bin/ads/ad7954a.cgi/3980/RETURN-CODE rverlander LQ Suggestions & Feedback 1 06-07-2002 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration