LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 01-25-2014, 07:59 AM   #1
krakanut
LQ Newbie
 
Registered: Aug 2012
Distribution: Slackware
Posts: 16

Rep: Reputation: Disabled
Retain file rights using cifs


Hello, I have a synology file server with a shared drive where I want to save some daily backups from a script in cron.daily. I set up a user on the synology which has security and read/write access to this share. I am using this user to establish my connection from my other server (slackware 14.1). syn was created in my /mnt as the share point. My fstab file is:

//synology/share /mnt/syn cifs uid=root,gid=root,rw,credentials=/etc/cifspwd 0 0

cifspwd file contains the user and password of the user on the synology which has rights to the share.

The fstab file runs and connects fine, however, a non root user from the slack machine is able to see and access the share as well as create and delete files from the share even though the files on the share are written as owner root and group root.

Questions:

1) How best to retain file rights on remote share?
2) Can I create a share that only root from slack machine can see and use?
3) Is cifs the preferred method for creating this connection rather than say nfs?
 
Old 01-25-2014, 04:47 PM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 865

Rep: Reputation: 264Reputation: 264Reputation: 264
Quote:
Originally Posted by krakanut View Post
a non root user from the slack machine is able to see and access the share as well as create and delete files from the share even though the files on the share are written as owner root and group root.

Questions:

1) How best to retain file rights on remote share?
2) Can I create a share that only root from slack machine can see and use?
3) Is cifs the preferred method for creating this connection rather than say nfs?
When you say a non-root user is able to see and access the share how do they do this as your post implies you need a log in password to access it.

As for file permissions CIFS is MS style permissions if you want UNiX style permissions you need to use NFS.

You can get a sort of permissions sync going on but it is more forced by setting the permissions at the mount point in fstab and again on the server with samba's config, however those permissions will be the same across all files in the share as it can only be done per share and not per file.
 
Old 01-25-2014, 10:12 PM   #3
Doug G
Member
 
Registered: Jul 2013
Posts: 595

Rep: Reputation: Disabled
Another option, you could create a tarball of the files you're backing up, with permissions, and save just the tar archive on the cifs share.
 
Old 01-26-2014, 06:47 AM   #4
krakanut
LQ Newbie
 
Registered: Aug 2012
Distribution: Slackware
Posts: 16

Original Poster
Rep: Reputation: Disabled
I had done additional research after my initial post and it appears that retaining file permissions on shares is no simple task but NFS seems to handle it best in nix world so I will look into this.

To my point of mounting a share from slack to Synology for root access only - is this possible with the fstab mount command? Or do I set permissions on the mount point itself /etc/syn?
 
Old 01-26-2014, 12:29 PM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
You can set the UID, GID, and umask of the mounted filesystem with the mount command. These options can be used to restrict access to the mounted share by users. As mentioned above, NFS handles *nix-style permissions better than CIFS, however by default the root user on an NFS client is not permitted to access a share as root (for security reasons) unless the no_root_squash option is used in the /etc/exports file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retain Multiple spaces and tabs in a file by c-sh file operation infosrig Linux - Software 3 02-22-2011 04:08 AM
How to retain .bashrc file? tulsi Linux - Newbie 3 09-08-2009 06:31 PM
retain file permission lightpace Linux - Newbie 1 12-06-2007 01:47 AM
Retain original squid.conf file ALInux Linux - Networking 1 06-02-2006 11:16 PM
Vi - retain position in file between invokations of vi Xanadu Linux - Software 1 12-23-2004 03:33 PM


All times are GMT -5. The time now is 04:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration