Ubuntu Create file owner problem

Source: Internet
Author: User

There is now an issue with Ubuntu that uses Ubuntu user login SSH but creates folders and files as root owner.
The folder you are using is created as follows:
File File = new file (fileName);
File.getparentfile (). Mkdirs ();
So how does file determine the owner of the files in the process of creation? This is based on the permissions that are used when the Tomcat service is started.
If sudo is used at SH startup.sh, then the owner of the folders and files created in the service will be rooted.
So the processing method is:
1. Turn off Tomcat
2.sh startup.sh reboot Tomcat
3. Change the owner of all files back to the statement used by the CHOWN-R account name file or directory
Using chown-r ubuntu 06 here, you have modified the 06 folder and the owner of all the recursive file boxes folders under the folder. Note that r must be in uppercase.

Ubuntu Create file owner problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.