All permission denied

Akraz

New member
Joined
Aug 11, 2004
Messages
4
I do not know if this is a DA problem or not but here it goes.

I believe that I have majorly screwed up. I was having problems with updating a game server I was hosting. When I would type the command, I would get permission denied. I was told to type the following command:

$ chgrp -R users *

I then got the error "-bash:" $ no such scommand

Me being an idiot, I know not to mess around with linux commands, but I failed otherwise and typed:

chgrp -R users *

(Since it said "$" was an unknown command, i tried it without it)

Anyway, the command started to execute. I know something wasnt right and CTRL+C'd right away to get out of it. I didnt think anything bad had happened. So I just went to start browsing some websites I was hosting. Then all of a sudden, about 10 domains that I host give me the following error:

You are not authorized to view this page
You might not have permission to view this directory or page using the credentials you supplied.


The funny thing is, some domains I host still work, but a good 10-15 of them are giving me "authorization denied". I went on DA and looked to see if permissions were changed. Everything was fine, all the .htaccess files were still there and nothing was altered.

Examples of domains that:

Work
www.cynetech.net

Don't Work
www.gogstv.com

Please help me as I am in great disbelief and ready to jump off a bridge. Any help would be appreciated.
 
Last edited:
I was experiment with permissions on the public_html folder and all folders are default 750. I then changed to 755 and it seems like the websites are working now? I dont understand if that is the right thing to do or not but it works.
 
Akraz said:
I do not know if this is a DA problem or not but here it goes.
It's not...
I believe that I have majorly screwed up. I was having problems with updating a game server I was hosting. When I would type the command, I would get permission denied. I was told to type the following command:

$ chgrp -R users *

I then got the error "-bash:" $ no such scommand
The "$ " shouldn't be typed; it indicates that you can type the command as a regular user; that you don't need to be root.
Me being an idiot, I know not to mess around with linux commands, but I failed otherwise and typed:

chgrp -R users *

(Since it said "$" was an unknown command, i tried it without it)

Anyway, the command started to execute. I know something wasnt right and CTRL+C'd right away to get out of it.
You'd be surprised how much damage a misdirected linux command can do in only a few seconds.

The amount of damaged you've done depends on what directory you were in when you typed the command. Do you even know?

While not as bad as "rm -R *" which will delete your entire drive, this might be very bad; it might even be unrecoverable.

Or it might be fairly easy to fix.
I didnt think anything bad had happened. So I just went to start browsing some websites I was hosting. Then all of a sudden, about 10 domains that I host give me the following error:

You are not authorized to view this page
The first step is to know the extent of the damage.

What directory were you in?

Does the server still seem to work? Does it still accept and delver mail?

Jeff
 
In the beginning years I accidentally chmoded all the files on my entire server to 777 :o

As Jeff said it really depends on what directory you were it when you ran the command. If you were in the /home directory then it will be easier to fix, just compare it to some user directories that weren't changed and chgrp back to the previous user and group but if you were in / ....... I won't go there :eek:

On the good side it sounds like you were in the /home directory only, if chmoding the file to 755 temporarily fixed it. If thats the case just run the same command but with the previous user and group and in the /home directory
 
Hey,

Being it was the /home directory, you'll have to check each file/directory and adjust the Owner/Group combinations.

The best thing to do is check a GOOD user/domain and make note of what the Owner/Group combinations are as there are some (logs and stats) directories that have different Owner/Group combos.

Then just go through each user/domain and adjust them.

At least the damage is more of a pain in the ass than being unrecoverable.

You could probably go to the /home directory and do this:

chgrp -R USERNAME USERNAME

The first USERNAME is the domain owner which should match the second USERNAME which is the directory you're changing. You'd have to do that for each USERNAME (customer).

Then, in each of the /home/USERNAME/domains/DOMAIN.COM directories change the logs and stats directories to Group root.

chgrp -R root stats
chgrp -R root logs

Also, the private_html directory is Group apache and there's a .shadow file in the USERNAME directory that's Group mail.

Now, there's a damn good chance I made a mistake somewhere in here... and, you already know what happens when you run commands someone posts.

But, others will read this post and hopefully add a few comments that might help both you and me!

David
 
alright thanks for the help, ill try them and ask around if its ok to do first :D
 
skruf's method should work just fine :)

A few notes.

The links in the /home/username/mail directory are
root:username

/home/username/domains/domain/stats is root:wheel

You should also be able to change them easily with the chown command.

e.g. chown -R username:groupname /home/username
etc.
 
Back
Top