Solved

chmod ???

Posted on 2000-04-09
4
407 Views
Last Modified: 2013-12-06
Hi ! I got a new webserver with red hat.
I want to chmod an directory, so that only my perl scripts have access to it and not any user by the www. How do I do this ?

+rwx  +rwx  -rwx ????

regards
ItsMe
0
Comment
Question by:ItsMe
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:jyu_88
ID: 2697794
question is who perl script runs as and what rights they require for this directory? If they are CGI scripts,and web server runs as 'nobody', and
1) you don't have SuEexc or CGI wrapper.
chown root:root privateDir
chmod 771 privateDir
The last bit of permission depends on what kind of access you perl script needs to this directory, ready some file under(771), write some file under(773)?

or more likeyly,
chown nobody:root privdateDir
chmod
2) you do have CGI wrapper or SuExec set up to run it as some legit user on your system, say, 'cgiowner'
chown cgiowner:root privdateDir
chmod 700 privdateDir
0
 

Author Comment

by:ItsMe
ID: 2697906
my script runs in /cgi-bin
i need to read and write some files in /cgi-bin/db or i use an dir lower than the www has access to. but there's the second problem: other users of the server have access to my scripts and files by their telnet account.
0
 
LVL 3

Accepted Solution

by:
jyu_88 earned 30 total points
ID: 2698195

/cgi-bin is just an alias, in other words, you can put your cgi-bin anywhere you can, far away from DocumentationRoot. my htdocs is at /home/httpd/htdocs while my cgi scripts are at /etc/httpdTo avoid local user to access those scripts, you can do something like:chown root:nobody cgiBinDirchown 750 cgiBinDirchown 770 cgiBinDir/dbThis way, user other than root and those in nobody group cannot access your cgibinDir.
0
 

Author Comment

by:ItsMe
ID: 2698443
thanks
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Steps to follow for Maintenance of Servers 4 63
Can't ping New Linux Servers 40 66
number in printf 13 27
Using Linux to replace Windows Server 2008 R2 for network drives 5 78
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question