Can't CHMOD files


My site was deleted and when it was restored some of my files need to be CHMODed to 777 to work…like the chat box and image uploader, but Cute FTP tells me I can’t because I don’t have permission…can anybody tell me if there is some thing I can do as Dream Host appearently shuts down for the weekend?


There may, or may not, be something you can do to change the permissions of the files - it depends upon who owns them now, and what permission they currently have.

Log into the shell and determine who owns the files. If you do not own them, you will probably need tech support to get you sorted out (if dhapache owns them, there may be another approach you can take).

If you do own the files, try using chmod from the command line in the shell - if that doesn’t work, you will probably need help from support.

DreamHost does not “shut down for the weekend”, though there are fewer tech support staffers working weekend hours than there are during the business week, so your response may not be as quick (though it can be!)



If you can log in using SSH, you might have better luck; or at least a better chance of figuring out what happened. Off the top of my head, the most likely thing I can think of is that when you restored the files, their ownership got set incorrectly for some reason. Using SSH, you can use ls -l in the folder where your files are located to check the file ownership. If the ownership turns out wrong, perhaps you could 1) download the file using FTP, 2) delete the file off the server, 3) upload the file back to the server using FTP, and 4) try again to CHMOD.

Also, not directly related to your problem, but are you sure that these files need to be 777? Giving any file world-write, especially if you do so along with world-execute, sounds the perfect recipee for a security disaster somewhere down the line.

[edit] Heh, nice to see I’m not the only one who thought of the ownership thing :wink: [/edit]


I appreciate the replys, but you may as well be speaking Egyptian.
I tried to log on with Putty, but got nowhere (probably because I don’t know what I am doing)
I guess I’ll wait for DH…it has already been 8 1/2 hours so maybe they will get to me soon.

Thanks for the replys


It’s definitely worth learning how to log in to your account using PuTTY. What isn’t working for you? Remember that you have to enable the user you’re using for shell access in the Web Panel under “Users>Manage Users”.

Use the [color=#CC0000]3DOM50[/color] promo code for 3 extra lifetime domains and $50 off
More Dreamhost coupons here!


User is enabled, but I don’t know any commands…and looked in the help files and wiki till my eyes crossed and bleed.

I can type ls -1 and see the folder list…but have no clue what to do next and there ARE NO INSTRUCTIONS as far as I can tell. If there is a list of commands or instructions to tell me how to check ownership, or CHMOD files with Putty will you please link me?


EDIT: I found a nice list of commands and headed back in


Heh, I got that feeling the first time I tried to set up the LAMP stack on a linux machine from scratch - hence my joy at finding that there were lots of web hosts who do all that stuff for you and provide nice web application installs as well! :slight_smile:

Here’s a link to a convenient Debian Linex Reference Card in multiple languages. It takes me back to the BSD reference card I had in college.

The two commands that you absolutely need are

ls -l to list files in long format to give you all the info you need - permissions, owner, group, etc.

cd <directory name> to change directory to - presumably you’re familiar with this one from DOS.

chmod 755 <filename>+ to change permissions - in this example to 755

Use the [color=#CC0000]3DOM50[/color] promo code for 3 extra lifetime domains and $50 off
More Dreamhost coupons here!


Thanks for the help, but I have ls - and cd this and that till I am pissssed!

It has been 19 hours and 21 minutes…I could have moved my stuff to and fixed it my damn self by now!!!

EDIT: AND YES…I have another site hosted on Godaddy and it never has problems…and they have a phone number to call and people there to answer!


Waaaaaah! Waaaaah!

Then maybe that’s where you should be hosting sites that you intend to “get deleted”, and then restored. :wink:

Show a little patience! DreamHost says they try to get back to you with support requests within 24 hours, not that they guarantee it (and you are still at less than that!).

So, do you still want help, or do you just want to throw a fit?



Sorry, I spent most of the night trying to access my files with Putty and as simple as it should be I had no luck. I hosted my site on Dream Host because a friend uses them and they offer more space. (which I found I really don’t need) I am old and slow to learn so it means a lot to have prompt customer support for problems like this, and I am not so sure who it was that deleted my site, but I understand DH was having server problems that night. I know it is a touchy subject, but godaddy backs up too…but I will never mention them again!

I really like learning new stuff, altho it usually crowds something else out of my dense mind and I soon forget it anyway, but if you will accept my apologies for the outburst and try to explain in simple terms how to get to my folder in question I would really appreciate it and I will make sure I stay inline in the future.

When I get on the server and type ls -1 here is what I see

Milk:~> ls -1

Inside the folder is a folder we will call chatbox and I need to CHMOD a file in it named chatterbox.php
Is that possible?

Again sorry for the outburst and thanks for the help.


Fair enough! Let’s see if we can get you sorted! :wink: You didn’t say how you “restored” your files, but it bears mentioning that DreamHost also “backs up” you stuff (in most cases) using their “.snapshot” directories. Usually, if you restore your files using them, all of your permissions remain intact, so this is something you might want to review for the future. :wink:

[quote]When I get on the server and type ls -1 here is what I see

Milk:~> ls -1
Good so far - everything that has to do with displaying/operating your site will be stored within the directory.

One intital part of the trouble you are having is likely related to your use of that “ls -1” command. The lower case “l” (the letter “L”) and the “1” (the numeral “One”) look very much the same (acutally, identical) in many fonts. The command you indicated above uses the numeral “1”, but the command should be using the letter lower-case “L” - and the difference is huge.

If you type in “ls -l” (or “ls -la”) you will get a very different display - one that will actually include permissions and ownership information, something like this:[servername]$ ls -l total (number of files) drwx------ 11 (user) (group) 4096 Sep 11 03:58 Maildir drwxr-xr-x 6 (user) (group) 4096 Aug 27 05:21 yourdomain.tld etc.... [servername]$ This is the type of display you want to see, so that you can tell who owns the various files/directories, and what permissions are set up for them.

In that display, the first column shows whether or not the item is a file or a directory and the assigned permissions. The column where I have indicated “(user)”, shows who “owns” the file/directory.

It may be possible, but we will not know till we know who owns the folders/files, and what the current permissions are. :wink:

If you run that “ls -l” (or “ls -la” - which shows “all files”) command again, using the "lower-case ‘L’ instead of a “1”) and post back with the results, we can go from there.

If you own all the files and directories you can probably change them yourself; if you don’t, you will probably need for DreamHost support folks to change it for you. :slight_smile:



Thank You
Here is what I get

milk:~> ls -l
total 16
drwxr-xr-x 32 root root 4096 2008-02-22 08:02
dr-xr-x— 4 gametechmods dhapache 4096 2007-07-29 16:34 logs
drwx------ 6 gametechmods pg1147405 4096 2008-02-22 09:28 Maildir
drwxr-xr-x 3 gametechmods pg1147405 4096 2007-12-11 18:58 svn

And when I type ls -al I get

milk:~> ls -al
total 36
drwxr-x–x 6 gametechmods pg1147405 4096 2008-02-24 07:38 .
drwxr-x–x 274 root 1000 12288 2008-02-22 04:08 …
-rw------- 1 gametechmods pg1147405 56 2007-08-04 20:59 .bash_history
drwxr-xr-x 32 root root 4096 2008-02-22 08:02
-rw------- 1 gametechmods pg1147405 742 2007-12-11 21:02 .history
dr-xr-x— 4 gametechmods dhapache 4096 2007-07-29 16:34 logs
-rw-r–r-- 1 gametechmods pg1147405 0 2008-02-24 07:38 ls
drwx------ 6 gametechmods pg1147405 4096 2008-02-22 09:28 Maildir
-rw------- 1 gametechmods pg1147405 39 2007-08-04 20:59 .mysql_history
drwxr-xr-x 3 gametechmods pg1147405 4096 2007-12-11 18:58 svn


Okay, now we are getting somewhere! Look at the line:

drwxr-xr-x 32 root root 4096 2008-02-22 08:02

…and let’s break it down so that you understand what you are seeing:drwxr-xr-x 32 root root 4096 2008-02-22 08:02 |__________________________ indicates that this entry is a directory |___________and indicates that "root" is the owner.This means that your user will not be able to change this directory.

Now, cd to the directory (cd, and/or cd to the directory (using your description), repeat the “ls -l” command again, and inspect that ouput to see who owns that directory and the various files (including the one you want to change the permissions on - chatterbox.php?).

If you see that “root” also owns them, and the permissions do not allow “world” writing (the last three letters define the permissions for the “world” or “others” users) then, once again, your user will not be able to change anything about those directories or files, because only “root” has been given “w” (“write”) permissions for those files.

This may be discouraging, but at least you will know the answer - it will require DH support to modify those directories/files ownerships so that you can control them… and just look at all you have learned! :wink:



Thanks for your help
I was actually able to see the .php I want to get at and I will try my best to remember what you taught me.
Again Thanks for the help.


You are most welcome! Just out of curiosity, was that .php file actually owned by root? :open_mouth:



Looks like root ownes all my files.

Just to be honest about the deal, I noticed Thursday morning my site was down and looked in the FTP and my entire folder was missing so I contacted DH and they restored it for me.
I did not notice till later that the chatbox and my uploaders I provide were not working.


Well, then there you have it. The “good news” is that you now do not have to worry about breaking any quotas (he he); the bad news is that DH will have to fix that for you to be able to manipulate your files.

I understand … and it looks like they restored then without resetting the ownership to you, so now unfortunately they will have to fix it. :frowning:

This is a good time for you to review that “snapshot” information I linked you to earlier. Should you find yourself in a similar situation in the future, restoring the files yourself via the snapshot directories will preclude you having to get support to do it for you, and eliminate the risk of them neglecting to change the file ownership/permissions. :wink:

At any rate, you are now well on the way to getting it resolved. Once DH support changes the file ownership back to your user, you should be able to manipulate the files any way you want.

Now that you know what the problem is, you may want to send them another support request explaining that you need the files’ ownership reset to your user; it might help you get a quicker response as they may see it as an “easy fix” instead of a “troubleshoot why this isn’t working” issue (and then again, it may not) Good Luck, and I hope you get it finally resolved soon!