LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-25-2017, 07:04 PM   #1
trackstar2000
Member
 
Registered: Apr 2013
Posts: 75

Rep: Reputation: Disabled
file permission


Looking for some help here. We bought a new NAS and facing this issue. We have a few shares that use both CIFS and NFS. Users from Windows drop files in the share and from a Linux machine an NFS is mounted and Nginx process the file. The vendor suggested we set the share as "CIFS" and create user mapping from the NAS.

When I tried to change the ownership (sudo chown -R nginx:nginx /mnt/test) to "nginx" (or any user) on the Linux machine, I am getting the following error on each file.

chown: changing ownership of ‘/mnt/test/index.html’: Operation not permitted

-------------------------------------------------------
So from the NAS user mapping (unix to windows), we have the following:

root -->webuseraccount in windows
nginx -->webuseraccount in windows


NFS mount as follows:

mount -t nfs myipaddress:/vol_digital /mnt/test

cat /proc/mounts show the volume as RW.

Any advice would be appreciated.

TT

Last edited by trackstar2000; 09-25-2017 at 07:08 PM.
 
Old 09-26-2017, 08:24 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Use cifs rather than ntfs:

mount -t cifs -o username=<webuseraccount>,password=<password>,uid=<UID>,gid=<GID> //<nas>/<directory> /mnt/test/BirstMetaData

The UID would be whatever numeric ID nginx has in /etc/passwd. The GID can be the primary for nginx or another group ID number. The "//<nas>/<directory>" is the the same URI used when you mount this share to Windows (reversing "" to "/" for Linux). Once mounted all files in /mnt/test will have nginix as owner.

In /etc/fstab that would be:
//<nas>/<directory> /mnt/test cifs username=<webuseraccount>,password=<password>,uid=<nginx numeric UID from /etc/passwd>,gid=<whatever group ID> 1 4
 
Old 09-26-2017, 10:50 AM   #3
trackstar2000
Member
 
Registered: Apr 2013
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MensaWater View Post
Use cifs rather than ntfs:

mount -t cifs -o username=<webuseraccount>,password=<password>,uid=<UID>,gid=<GID> //<nas>/<directory> /mnt/test/BirstMetaData

The UID would be whatever numeric ID nginx has in /etc/passwd. The GID can be the primary for nginx or another group ID number. The "//<nas>/<directory>" is the the same URI used when you mount this share to Windows (reversing "" to "/" for Linux). Once mounted all files in /mnt/test will have nginix as owner.

In /etc/fstab that would be:
//<nas>/<directory> /mnt/test cifs username=<webuseraccount>,password=<password>,uid=<nginx numeric UID from /etc/passwd>,gid=<whatever group ID> 1 4
I thought about this a while ago (mounting as CIFS). Wouldn't the password be stored and considered not secure?

I saw this where they put the password in a file.

http://jensd.be/229/linux/mount-wind...n-a-secure-way

Thanks again.
TT

Last edited by trackstar2000; 09-26-2017 at 11:24 AM.
 
Old 09-26-2017, 12:36 PM   #4
trackstar2000
Member
 
Registered: Apr 2013
Posts: 75

Original Poster
Rep: Reputation: Disabled
Regarding the original post. We are able to create a file from the linux machine but able to change ownership.
 
Old 10-01-2017, 10:58 AM   #5
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 4,179

Rep: Reputation: Disabled
Possibly you need to ssh into the server to change ownerships of files on it.
 
Old 10-02-2017, 10:28 PM   #6
trackstar2000
Member
 
Registered: Apr 2013
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fatmac View Post
Possibly you need to ssh into the server to change ownerships of files on it.
It shows the appropriate permission.

MensaWater,

Your suggestion works! We went ahead and implemented a hidden file where only root could view and added to fstab.
 
1 members found this post helpful.
  


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
Not able to move a file to /tmp, file command shows no read permission JockVSJock Linux - Security 16 09-29-2016 12:45 PM
[SOLVED] ext4 - permission to create/modify a file without 'delete' permission BeachHead Linux - General 4 06-08-2014 07:34 PM
File & Folder Permission and Ownership permission error in Cloud storage. rhcekumaran Linux - Newbie 3 06-14-2013 04:41 AM
[SOLVED] Apache 403 file permission error when accesing a symlink file (CentOS 6.3) mkvakic Linux - Newbie 7 02-13-2013 03:25 AM
Reading ext3 file system on Mac and overriding file permission moravveji Other *NIX 6 09-12-2011 02:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:51 PM.

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
Open Source Consulting | Domain Registration