LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-13-2020, 03:29 AM   #1
1s440
Member
 
Registered: Mar 2018
Posts: 266

Rep: Reputation: Disabled
cifs share


Hi all,

We have a cifs share mounted on the linux server with the user as below

mount -t cifs /tmp/data /xxx/xxx/data -o user=tobhia,password=welcome123,domain=xxxx

How can i check if the user "tobhia" has access to the folder "data" ?

Earlier we dont have access to the subfolders under cifs share(which has already mounted) now has access to the subfolders. Should we remount it again to access the subfolders as user tobhia?
 
Old 08-13-2020, 04:31 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by 1s440 View Post
mount -t cifs /tmp/data /xxx/xxx/data -o user=tobhia,password=welcome123,domain=xxxx
This doesn't look correct. There should be a double slash somewhere, perhaps //tmp/data?
Quote:
How can i check if the user "tobhia" has access to the folder "data" ?
I wonder if I understand your problem, but this tells you if tobhia has read access to that directory:
Code:
su tobhia -c "ls /xxx/xxx/data"
For write access, use touch.
Quote:
Earlier we dont have access to the subfolders under cifs share(which has already mounted) now has access to the subfolders. Should we remount it again to access the subfolders as user tobhia?
I don't know why you didn't have access earlier, and it's not clear to me which problem you want to solve by remounting. Can you rephrase the question?
 
Old 08-13-2020, 04:55 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
The correct syntax is
Code:
 mount -t cifs //remote/share /mount/dir
Does not matter if option are before or after the //remote/share /mount/dir. user is the username used to access the remote share and not necessarily the same as on the local system. The best way to know if the username has access to a share is to verify their permissions on the remote computer.

Last edited by michaelk; 08-13-2020 at 04:57 AM.
 
Old 08-13-2020, 05:01 AM   #4
1s440
Member
 
Registered: Mar 2018
Posts: 266

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
The correct syntax is
Code:
 mount -t cifs //remote/share /mount/dir


Does not matter if option are before or after the //remote/share /mount/dir. user is the username used to access the remote share and not necessarily the same as on the local system. The best way to know if the username has access to a share is to verify their permissions on the remote computer.
When i try to mount the share i get the below error. There is an entry in the fstab

Code:
mount -t cifs //tmp/data/ /xxx/xxx/data -o user=thobia,password=welcome123,domain=domain
Couldn't chdir to /xxx/xxx/data: No such file or directory

Last edited by 1s440; 08-13-2020 at 05:02 AM.
 
Old 08-13-2020, 05:06 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Post the entry from the fstab file.
 
Old 08-13-2020, 05:09 AM   #6
1s440
Member
 
Registered: Mar 2018
Posts: 266

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
This doesn't look correct. There should be a double slash somewhere, perhaps //tmp/data?

sorry doubleslash is missed

I wonder if I understand your problem, but this tells you if tobhia has read access to that directory:
Code:
su tobhia -c "ls /xxx/xxx/data"
For write access, use touch.

unfortunately touch access doesnot work. I always have permission denied.

I don't know why you didn't have access earlier, and it's not clear to me which problem you want to solve by remounting. Can you rephrase the question?
This share is from remote location and we are just mounting it to access it. Earlier we had access only to the parent folder. But now we also got access to the subfolders.
 
Old 08-13-2020, 05:11 AM   #7
1s440
Member
 
Registered: Mar 2018
Posts: 266

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Post the entry from the fstab file.
Code:
//tmp/data/ /xxx/xxx/data cifs user=thobia,password=welcome123,domain=domain,noserverino,_netdev 0 0
when i just use
Code:
 mount /xxx/xxx/data
mount error(112): Host is down
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Last edited by 1s440; 08-13-2020 at 05:13 AM.
 
Old 08-13-2020, 05:17 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
//remote/share -> remote is a host name or an ip, share is the name of the samba share (which you want to access from your linux box).
/tmp/data most probably your mount point, that is not a share, but a local directory.
in fstab the first column is the remote share and the second one is the mount point. I think you mixed it.
 
Old 08-13-2020, 05:21 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
//tmp would be the remote computer hostname which does not look correct and why both berndbausch and I question the syntax of your command. Again the device or remote computer/share needs to be first. I assume that /xxx/xxx is the remote computer which is why you obfuscated the information.

Code:
//xxx/xxx/data /tmp/data cifs user=thobia,password=welcome123,domain=domain,noserverino,_netdev 0 0
This makes more sense.
 
Old 08-13-2020, 05:25 AM   #10
1s440
Member
 
Registered: Mar 2018
Posts: 266

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
//remote/share -> remote is a host name or an ip, share is the name of the samba share (which you want to access from your linux box).
/tmp/data most probably your mount point, that is not a share, but a local directory.
in fstab the first column is the remote share and the second one is the mount point. I think you mixed it.
YOu mean fstab entry is wrong?
 
Old 08-13-2020, 05:28 AM   #11
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
not really. I mean you need to check if the host name is tmp, the share name is data and the local mount point is /xxx/xxx/data.
From my side it is ok, but I'm not sure if that was correct. You need to check and decide.
 
Old 08-13-2020, 05:31 AM   #12
1s440
Member
 
Registered: Mar 2018
Posts: 266

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
//tmp would be the remote computer hostname which does not look correct and why both berndbausch and I question the syntax of your command. Again the device or remote computer/share needs to be first. I assume that /xxx/xxx is the remote computer which is why you obfuscated the information.

Code:
//xxx/xxx/data /tmp/data cifs user=thobia,password=welcome123,domain=domain,noserverino,_netdev 0 0
This makes more sense.

I have some mount issues now when i use[code] "mount /xxxx/xxxx/xxxx/share"

I get error "Host is down"

When I use [code]mount -t cifs //remotehostname/share/ /xxxx/xxxx/xxxx/share -o user=username,password=passwd,domain=domain,noserverino,_netdev,vers=2.0

I get "Couldn't chdir to /xxxx/xxxx/xxxx/share: No such file or directory"

Earlier it was working fine. I have requested for permissions for the subfolders on the remote cifs share


I have two problems

Last edited by 1s440; 08-13-2020 at 08:27 AM.
 
Old 08-13-2020, 05:33 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
If /xxxx/xxxx/xxxx/share directory does not exist it needs to be created.

Last edited by michaelk; 08-13-2020 at 05:36 AM.
 
Old 08-13-2020, 05:34 AM   #14
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
so /xxxx/xxxx/xxxx/share (or whatever is it) is a directory which should be created before you execute that mount command.
 
Old 08-13-2020, 05:55 AM   #15
1s440
Member
 
Registered: Mar 2018
Posts: 266

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
so /xxxx/xxxx/xxxx/share (or whatever is it) is a directory which should be created before you execute that mount command.
directory is already present but somehow it says not found. Not sure it all happened after the reboot.

Last edited by 1s440; 08-13-2020 at 06:22 AM.
 
  


Reply



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
Cifs "mount error 13 = Permission denied" CIFS SUCKS humbletech99 Linux - Networking 45 04-06-2020 05:31 AM
[SOLVED] CIFS share on old WinNT host - smbclient works, mount -t cifs doesn't Electrode Linux - Networking 4 04-19-2012 09:11 AM
manual mount cifs works but srcipt mount cifs has mount error (13): Permission denied CADIT Linux - Newbie 6 11-20-2009 02:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:25 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