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: http://cl.ly/e2192e6aadc8e4688c33

Any help is appreciated.

3 Answers 3


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>
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.

  • Oh I read that wrong, forget the find command if you only want to delete a particular file, use rm. May 26, 2010 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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