[SOLVED] Cannot backup files because of read permissions
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I want to backup files in a folder to a network Share, from Ubuntu 12.04 to Windows 7.
Files have no read/write permissions, i have to "sudo chmod -R 777 Backup/" everytime.
But new files created in that directory will still have no read/write permissions, so i must chmod this folder everyday. Files are created by an application, daily...can i set a default create mask somewhere?
also how do you have the cifs mount point mounted and what permissions are on the win7 box? in many cases when dealing with a cifs mount point the problem resides in the permissions settings on the MS Windows computer.
Bash built-in umask or environment variable UMASK, coupled with the owner & group of the directory, set default permissions. But, to me, it is not clear whether your problem is with the directory where files are created (on Ubuntu) or the directory where you want to backup to (Win 7 share).
Win7 share works fine, i can manage files over the network from anywhere. I havent mounted the Win7 folder, just used LuckyBackup GUI with a network destination, which gave access denied error (cannot read from source).
When i create a file in that folder manually, it will have the correct permissions... just the ones created by that application.
I will check the ID, the exact error and permissions next time i visit the site.
It's an accounting software, a server application. Just a folder copied to this machine and then probably added to startup via Ubuntus GUI. Clients connect to this machine via an ip and specified port.
On older machines it was added to startup via rc.local file using "screen" command, but not on this machine.
[I just spent half an hour writing a long, considered reply, only get an error msg when I submitted the post that the f.... token had expired. I am seriously pissed off that all that work is gone. Looking at the cookies, it seems the token has an expiry of roughly 40 minutes. Jeremy, this is too short.]
So, you get the brief version.
The files are being created as root.
The application should not be running as root. It is a security risk for apps that accept outside connections to run as root, since anyone who can exploit the app can end up owning the machine and then get onto the shares as well.
If the app needs to run as root to open system ports (those < 1024), it is badly written. It should fork to a non-root user after opening the ports or else use only non-system ports.
If it is running as root simply because it is owned by root and runs from a startup script that runs as root, then write a brief shell script that su's to a non-root user that starts the app.
I suggest using whatever daemonize utility is provided by your distribution. That way, you know it has been tested for a wide variety of situations. Debian provides start-stop-daemon, RH has a daemon utility, Slackware has a daemon function in /etc/init.d/functions which you can include in your start script.
The advantages of these is that they can start up the app with whatever user you specify, they check for other things like is the process already running, they can shut it down cleanly, and so on.