LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-21-2012, 11:58 AM   #16
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled

[root@myServer cgi-bin]# /bin/ls -l
total 4
drwxr-xr-x 2 root psacln 4096 Mar 21 01:11 test
 
Old 03-21-2012, 10:26 PM   #17
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Unanswered questions
  1. Are the /var/www/vhosts/<domain name>/cgi-bin/test files on the / file system as appears from /proc/mounts? (post 4)
  2. Can you change the holding directory's owner to root? (post 8)
  3. What has changed between the first and fourth posts? Usually when the owner is just a UID, not an actual username, it means you're working on a network filesystem (NFS, etc), which means root won't have the same permissions as on the local filesystem. (post 13)
 
Old 03-22-2012, 02:34 AM   #18
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by catkin View Post
Unanswered questions
  1. Are the /var/www/vhosts/<domain name>/cgi-bin/test files on the / file system as appears from /proc/mounts? (post 4)
[root@myServer cgi-bin]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sda3 ext3 136180620 104548076 24603304 81% /
/dev/sda1 ext3 101086 16372 79495 18% /boot
tmpfs tmpfs 2074912 0 2074912 0% /dev/shm
tmpfs tmpfs 2074912 0 2074912 0% /usr/local/psa/handlers/before-local
tmpfs tmpfs 2074912 0 2074912 0% /usr/local/psa/handlers/before-queue
tmpfs tmpfs 2074912 0 2074912 0% /usr/local/psa/handlers/before-remote
tmpfs tmpfs 2074912 2060 2072852 1% /usr/local/psa/handlers/info
tmpfs tmpfs 2074912 84656 1990256 5% /usr/local/psa/handlers/spool

[root@myServer cgi-bin]# mount
/dev/sda3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
tmpfs on /usr/local/psa/handlers/before-local type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/before-queue type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/before-remote type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/info type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/spool type tmpfs (rw,mode=0770,gid=31)


Quote:
Originally Posted by catkin View Post
[*]Can you change the holding directory's owner to root? (post 8)
Quote:
Originally Posted by catkin View Post
[*]What has changed between the first and fourth posts? Usually when the owner is just a UID, not an actual username, it means you're working on a network filesystem (NFS, etc), which means root won't have the same permissions as on the local filesystem. (post 13)
I login to plesk page when I posted my forth post

Thanks
 
Old 03-22-2012, 04:06 AM   #19
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 106Reputation: 106
Lightbulb



Try to see what is accessing it & kill the process

Code:
fuser -ifk test
 
Old 03-22-2012, 05:15 AM   #20
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
[root@myServer cgi-bin]# fuser -ifk test
[root@myServer cgi-bin]#

Nothing happened by running this command. thanks for your reply
 
Old 03-22-2012, 07:20 AM   #21
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,847

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
can you look at /var/log for error messages related to that directory?
 
Old 03-22-2012, 08:06 AM   #22
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
I check /var/log/messages but nothing about cgi-bin/test or test or cgi-bin

thanks
 
Old 03-22-2012, 09:53 AM   #23
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
ls -l ../cgi-bin
 
Old 03-22-2012, 12:58 PM   #24
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
[root@myServer cgi-bin]# ls -l ../cgi-bin
total 4
drwxrwxrwx 2 medical5 psacln 4096 Mar 21 01:13 test
[root@myServer cgi-bin]#

Last edited by Raakh5; 03-22-2012 at 01:00 PM.
 
Old 03-22-2012, 01:40 PM   #25
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
I am sorry Raakh5 I meant ls -l ../ so that we could see the permissions on cgi-bin.
 
Old 03-22-2012, 01:53 PM   #26
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
[root@myServer cgi-bin]# ls -l ../
total 4
drwxr-x--- 3 10041 psaserv 4096 May 2 2010 cgi-bin
[root@myServer cgi-bin]#

There is point to be noted that in this post catkin was drawing my attention in post with time stamp "Yesterday 10:26 PM catkin"
drwxrwxrwx 2 medical5 psacln 4096 Mar 21 01:13 test

Now with your stated command its showing two users. Why there are two users whereas I never given any privileges to medical5?

Thanks again
 
Old 03-22-2012, 02:04 PM   #27
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
medical5 is the user, psacln is the group
 
Old 03-22-2012, 02:46 PM   #28
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
What I did now is as follow:
[root@globalsteelweb cgi-bin]# ls -l ../cgi-bin
total 4
drwxrwxrwx 2 10013 psacln 4096 Mar 21 01:13 test
[root@globalsteelweb cgi-bin]# chown root test
[root@globalsteelweb cgi-bin]# ls -l ../cgi-bin
total 4
drwxrwxrwx 2 root psacln 4096 Mar 21 01:13 test
[root@globalsteelweb cgi-bin]# rm -rf test
rm: cannot remove directory `test': Permission denied
[root@globalsteelweb cgi-bin]# chgrp root test
[root@globalsteelweb cgi-bin]# ls -l ../cgi-bin
total 4
drwxrwxrwx 2 root root 4096 Mar 21 01:13 test
[root@globalsteelweb cgi-bin]# rm -rf test
rm: cannot remove directory `test': Permission denied
[root@globalsteelweb cgi-bin]#

thanks
 
Old 03-23-2012, 01:48 AM   #29
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
This is very puzzling. To sum up the investigation so far:
  • rm -fr test results in "permission denied".
  • There are no ACLs on test.
  • The test directory is on a local writeable file system.
  • test's parent directory is not writeable by root.
I just tested a similar setup and was able to remove the test directory even without using rm's -f option:
Code:
c@CW8:~$ mkdir -p /tmp/cgi-bin/test
c@CW8:~$ chmod 750 /tmp/cgi-bin/
root@CW8:~# rm -r /tmp/cgi-bin/test/
[no output, directory test was removed]
Are there any files in the test directory? Can you create and delete files? What happens if you try to change ownernship of test's parent directory to root? Here are commands to test that, assuming cgi-bin is your current directory:
/bin/ls -l test
touch testfile test/testfile
rm testfile test/testfile
chown . root
touch testfile
rm testfile
rm -fr test
 
Old 03-23-2012, 02:46 AM   #30
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
Thanks for helping me continuously

[root@myServer ~]# cd /var/www/vhosts/myDomain/cgi-bin
[root@myServer cgi-bin]# /bin/ls -l test
total 0
[root@myServer cgi-bin]# ls
test
[root@myServer cgi-bin]# ls -l
total 4
drwxrwxrwx 2 root root 4096 Mar 22 23:09 test
[root@myServer cgi-bin]# touch testfile test/testfile
touch: cannot touch `testfile': Permission denied
[root@myServer cgi-bin]# chown . root
chown: cannot access `root': No such file or directory
[root@myServer cgi-bin]#

Regards

Last edited by Raakh5; 03-23-2012 at 04:34 AM.
 
  


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
What is the command for deleting a directory? runnerpaul Linux - Newbie 5 03-22-2007 08:20 AM
Deleting a directory esm03 Linux - Newbie 2 06-28-2006 11:15 AM
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 06:05 AM
Deleting a directory... closet geek Linux - General 7 07-09-2003 06:25 AM
deleting non-empty directory sadiboyz Linux - Newbie 2 04-21-2003 09:29 PM

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

All times are GMT -5. The time now is 01:46 AM.

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