I have a ESXi VM on which I have installed OpenSuse 12.3
I have a windows 7 VM (again on ESXi) which has a drive called e
I want to share e on Opensuse so that a commandline application can read files from that share.
What I Did:
I (logged in as a user named admin) ran the following command :
mount -t cifs //windowsserver/e /home/mymnt/share -o username=username Then pressed Enter
Open Suse asks for password of username - which I entered.
Now the Windows drive e is mounted on /home/mymnt/share
I can see the folders and files. However when the command line application tries accessing the file it fails.
However the same command line app, runs fine if the file is located locally.
It somehow seems that the command line is having issues reading the file.
If I go to one of the files located in the share and right click > Properties > Permission tab
Owner: Can Read and Write
Group: Can Read
Others: Can Read
Can anyone please help me out here as I have spent enough time trying to troubleshoot this.
On the openSUSE PC you need to setup Samba. Further, you must setup a folder with permissions of 777 as root that you want to share. I would NOT use the same share name of e and I would use a longer and better descriptive name. I have a bash script that can create the proper Samba default config file in which you must add the folder to be shared. Here is the blog on the subject.
Am describing the following based on your description which seems to imply your problem isn’t “reading” a file but to execute.
Since you mounted specifying CIFS, I doubt that SAMBA is needed or that your SAMBA client is already installed. In fact, I see that you describe able to browse the share, are able to read and likely read the files but unable to execute.
IMO
You may need to understand how share permissions work.
Share permissions are typically implemented as a separate layer of permissions on top of system level permissions so there are actually <two> layers of permissions to look for troubleshooting the lack of execute permission.
So, for starters you didn’t describe what type of User credentials you used to access the Share. It would have to be some kind of Windows account, but is it a Local Account or a network (eg Active Domain) Account? Depending on what type of account, you will need to specify.
After verifying that the Windows User credentials are sufficient,
Then you will need to consider whether those credentials have sufficient permissions to execute locally on your machine. If you used network (eg Active Domain) credentials and you logged into your network with those credentials, then you shouldn’t have had a problem. But, if you logged into your openSUSE with different credentials (eg local openSUSE credentials), then your credentials wouldn’t match the ACLs on the network share so could be missing sufficient permissions.
My guess is that last scenario is your situation. Although it’s possible to modify the permissions on Win7 to allow Everyone/Everyone/Everything permitted, of course that could be dangerous.
Instead, I recommend you allow things to operate as things are now.
Or, install network security (eg AD, openLDAP, etc).
drwxr-xr-x 2 root root 4096 Nov 18 14:05
drwxr-xr-x 3 root root 4096 Nov 18 14:05
I have edited the smb.config to
[Windows]
path = /Windows
read only = No
acl check permissions = No
inherit acls = Yes
guest ok = Yes
profile acls = Yes
I can see the files when I manually mount them (But as I said my application can’t read them)
Also, the automount doesn’t seem to happen on a restart.
I have given the credentials in fstab file (for the windows username and password)
Thanks for your response. So my windows user is a local user on windows machine called admin.
When I mount using admin, it mounts manually , but if I put all details in fstab file - it doesn’t automount.
???
That’s definitely not the whole output… At least the filenames are missing.
And did you have the share mounted when running this?
Doesn’t look like it was, so please mount it first.
I can see the files when I manually mount them (But as I said my application can’t read them)
Also, the automount doesn’t seem to happen on a restart.
I have given the credentials in fstab file (for the windows username and password)
Probably the network isn’t up completely when the share is mounted.
Are you using NetworkManager?
Then try to switch to ifup in YaST.
Yes…My mount was’t up…but when my mount is up…it lists all the directories in the share.
Also, yes Iam using the network manager.
I had similar issue in CentOS but it seemed to have got resolved on its own - only OpenSuse is giving this problem.
This are my work computers and I am currently meesaging from my home - so Sorry can’t copy paste the output.
On 11/21/2013 10:36 AM, blueberret wrote:
>
> Hi There,
>
> Thanks for your response. So my windows user is a local user on windows
> machine called admin.
> When I mount using admin, it mounts manually , but if I put all details
> in fstab file - it doesn’t automount.
>
> my fstab entry looks like this:
>
> //servername/e /mnt/e cifs
> users,file_mode=0664,dir_mode=0777,auto,username=admin,password=********,_netdev
> 0 0
>
>
blueberret;
Try adding the options:
uid=<YourUserName>
gid=<YourGroup>
e.g.
uid=JohnDoe,gid=users
As MS Windows permissions is different from Linux/Unix, this sets ownership of the mounted system on your NIX system.
See: man mount.cifs
–
P.V.
“We’re all in this together, I’m pulling for you” Red Green
You can’t use the folder name of “/mnt/e” if Sambe is using the folder name of “/Windows”. Samba does allow the share name to be different, but I would not use the existing folder of /mnt for anything. I am trying to set the Samba share name and actual folder you share to be the same while different to any Windows share name, to prevent confusion. Further I use only NTFS partitions for Windows shares and I use partitions mounted from my fstab file and the base mount option for NTFS is to be defaults with other speed enhancing mount options. I do this with many networked computers with a mix of Windows and openSUSE PC’s. It works like a champ on a standard workgroup setup. I do wonder if you understand what I propose or not. I have offered up a bash script that can perform all Samba required tasks for setup, testing and program modifications called S.A.C.T. you can find here I hope you have looked.