Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Running apache on rhel server and sometimes I need to delete some files that I can not using my FTP program, because the FTP account I am logged into is not the apache user.

I am on a Mac and there must be a way to accomplish this via terminal by either SSH'ing into the server.

What credentials would I need to ssh into the server and delete the files/folders owned by apache

Screen shot will show you what I mean when the file is owned by the apache user/group:

Any help is appreciated.

share|improve this question
up vote 2 down vote accepted

This would normally be achieved by having a shell account on the server and access to suitable commands via sudo.


login somehow

cd /web/ee_web/images/sized/images/calendar-images

sudo rm <somefile>
share|improve this answer
find /path/to/folder -user apache -print0 | xargs -0 rm

Add type -f if you don't want to include directories.

If you are member of the group apache, the files group is apache, and the group has write permissions to the directory the file lives in you can delete it. Otherwise, you need to be root.

share|improve this answer
Oh I read that wrong, forget the find command if you only want to delete a particular file, use rm. – Kyle Brandt May 26 '10 at 15:19

You need user account on the server (login/password may be different, than for your ftp-account). This user must be root or have permissions to run sudo.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.