mistake - I ran "find / -type d -exec chmod 755 {} \;"

hisairnes

Verified User
Joined
Feb 23, 2011
Messages
12
Hi everyone!

This is my first post here ;-)

I ran by mistake command : find / -type d -exec chmod 755 {} \;

Very bad !

Is it any script to set default permissions on debian lenny server with directadmin.

Maybe this gonna help ?

Code:
cd /usr/local/directadmin/scripts
./set_permissions.sh all

Any suggestions ?
 
not totally sure but i think that file just set permission on stuff that directadmin control... but, not sure about system files.

Hope someone else would reply to you, yes, bad command line act... you need to pay more attention :)

Well, once i did something worst then this... rm -rf /*

Never did again those errors... double check every command now :)

Regards
 
I ran set_permissions script and have problem

Code:
2011-02-23 12:01:27 login authenticator failed for (#########) [87.116.195.158]: 435 Unable to authenticate at present (set_id=######@####.com.pl): Undefined subroutine &main::smtpauth called.

2011-02-23 12:01:39 login authenticator failed for (#########) [xxx.xxx.xxx.xxx]: 435 Unable to authenticate at present (set_id=#####@x.com.pl): Undefined subroutine &main::smtpauth called.

2011-02-23 12:05:25 failed to open /etc/virtual/domains for linear search: Permission denied (euid=8 egid=8)
2011-02-23 12:05:27 TLS error on connection from (MZ) [87.116.195.158] (SSL_CTX_use_certificate_chain_file file=/etc/exim.cert): error:0200100D:system library:fopen:Permission denied
2011-02-23 12:05:33 TLS error on connection from (ANNASW) [87.116.195.158] (SSL_CTX_use_certificate_chain_file file=/etc/exim.cert): error:0200100D:system library:fopen:Permission denied

Users can't send mails.
Bind can't start.

HELP !!!!
 
Still the same error...


Code:
2011-02-23 14:33:58 exim 4.67 daemon started: pid=26754, -q15m, listening for SMTP on port 25 (IPv4) port 587 (IPv4)
2011-02-23 14:33:58 re-exec of exim (/usr/sbin/exim) with -q failed: Permission denied
2011-02-23 14:34:24 TLS error on connection from (#####) [xxx.xxx.xxx.xxx] (SSL_CTX_use_certificate_chain_file file=/etc/exim.cert): error:0200100D:system library:fopen:Permission denied
2011-02-23 14:34:55 TLS error on connection from (xx.xx.pl) [xxx.xxx.xxx.xxx] (SSL_CTX_use_certificate_chain_file file=/etc/exim.cert): error:0200100D:system library:fopen:Permission denied
2011-02-23 14:34:55 failed to open /etc/virtual/domains for linear search: Permission denied (euid=8 egid=8)
 
That isn't a permission error you are getting. That looks more like you have the wrong /etc/exim.pl script for the version of /etc/exim.conf you have. Where did you get each of them? At least that is the issue with the:
Undefined subroutine &main::smtpauth called.

2011-02-23 12:05:25 failed to open /etc/virtual/domains for linear search: Permission denied (euid=8 egid=8)

Error.

What are the owner/group id of your /etc/exim* files and your /etc/virtual directory?
 
Last edited:
With that, you'd better hire somebody or re-install OS.

Other way you can go, it is to make a full list of all files with permissions from a working box, and with a simple script to restore permissions on your box.
 
Hi.

I have a new machine with Debian 5 and DA (temporary license)

Try to do Backup/Restore Users and get error


/var/log/directadmin/errortaskq.log

Code:
Major Error: Error finding home for admin
getpwnam(admin) == NULL : Success

......
......
......
etc.

I can't do backup for all admins/resellers ... :mad:

/var/log/directadmin/system.log:

Code:
Running Backup: type=admin owner=admin id=(null)
 
I created script, which contains commands to restore permissions

I ran it on my new server with DA and then copy the resulting scripts to my old server and ran it.

It's a bit risky, but I have no choice.

Backup permissions script below

Code:
#!/bin/sh

WHERE=$PWD

#FOLDER /bin
touch /$WHERE/bin.sh
echo '/bin/sh'>/$WHERE/bin.sh
find /bin -printf "chown %u:%g %p && chmod  %m %p\n">>/$WHERE/bin.sh

#FOLDER /sbin
touch /$WHERE/sbin.sh
echo '/bin/sh'>/$WHERE/sbin.sh
find /sbin -printf "chown %u:%g %p && chmod  %m %p\n">>/$WHERE/sbin.sh

#FOLDER /lib
touch /$WHERE/lib.sh
echo '/bin/sh'>/$WHERE/lib.sh
find /lib -printf "chown %u:%g %p && chmod  %m %p\n">>/$WHERE/lib.sh

#FOLDER /usr
touch /$WHERE/usr.sh
echo '/bin/sh'>/$WHERE/usr.sh
find /usr -printf "chown %u:%g %p && chmod  %m %p\n">>/$WHERE/usr.sh

#FOLDER /etc 
touch /$WHERE/etc.sh
echo '/bin/sh'>/$WHERE/etc.sh
find /etc -printf "chown %u:%g %p && chmod  %m %p\n">>/$WHERE/etc.sh

#FOLDER /opt
touch /$WHERE/opt.sh
echo '/bin/sh'>/$WHERE/opt.sh
find /opt -printf "chown %u:%g %p && chmod  %m %p\n">>/$WHERE/opt.sh

#Folder /var
touch /$WHERE/var.sh
echo '/bin/sh'>/$WHERE/var.sh
find /var -printf "chown %u:%g %p && chmod  %m %p\n">>/$WHERE/var.sh

chmod +x /$WHERE/*.sh
 
Back
Top