1

I have the next problem, i have 2 servers (debian) and each one have install tomcat.

The first server (192.168.0.100) have installed tomcat with their default permissions in every folder (and that’s ok).

But , in my second server (192.168.0.101), someone here put chmod 777 –R to every folder in tomcat, and I don’t know how to restore to the original permissions in every folder.

So, my question is, it’s possible copy the permissions tomcat’s folders from the first server (192.168.0.100) and then set that permissions in tomcat’s folders of the second server (192.168.0.101) ??

Regards

1
  • Someone put chmod on purpose, or maybe is it a file system, e.g. FAT, not supporting UNIX permissions?
    – caylee
    Apr 4, 2018 at 15:26

1 Answer 1

1

Yes, it is possible. You can either copy the folder with scp -pr, preserving permissions and replace it with the old one, or, if the contents, but not the files differ, you can copy it (preserving permissions) and clone permissions:

chmod -R --reference REMOTEFOLDER LOCALFOLDER
chown -R --reference REMOTEFOLDER LOCALFOLDER

The following answer could also be helpful: https://unix.stackexchange.com/a/20646

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .