3

I am trying to access a win7 machine that has sharing enabled on a folder. When I mount it on linux it lists all files as -rwxr-xr-x 1 root root

If i sudo i can copy files back and forth but its read only if I dont.

sudo chown [standard_user] * on the mounted share does nothing.

This mounts the share as read only (all files are root) sudo mount -t cifs "//myipaddress/myshare" /home/myuser/mymount/ -o username=myusername,password=mypassword,rw

On the win7 box I have myuser and everyone as 'full control'

how do I mount this share so that I dont have to be root to delete/move files?

1

Try the following. Works fine for me.

sudo mount -t cifs -o vers=1.0,username=myuser,pass=mypass "//myipaddress/myshare" /home/myuser/mymount/
9
mount -t cifs "//myipaddress/myshare" /home/myuser/mymount/ -o username=myusername,password=mypassword,uid=myusername,gid=users
  • If an answer helps you, accept it by clicking on the small grey tick/check beneath the number on the left hand side of the answer @flashc5 , once you have enough reputation you can upvote too. All this information is in the tour, reading it will also get you your first badge woo-hoo! – Arronical Mar 7 '17 at 17:16
  • i alsways do, it makes you wait so many minutes before you can mark it as the answer – flashc5 Mar 7 '17 at 17:25
  • This worked, but all the files created through the mount are now -rwxrwxrwx. Is there a way to change this? – Rogier Lommers Sep 10 '18 at 18:34
  • @RogierLommes I do not think that this is possible on a per file basis (as MS file systems do not support linux file permissions). – Bruni Sep 11 '18 at 6:27
0

You have to make sure the mounting target is owned by the user/group first.

Change directories ownership

sudo chown myusername:mygroupname /mymount/

Mount it to home dir

mkdir ~/mymount
sudo mount /path/to/partition ~/mymount
  • while this solution is correct, I would advise against blindly changing permissions/ownership of files/directories if you don't know what you're doing – j-money Mar 27 at 10:23
0

vi /user/credfile username=user password=pass domain=mydomain.local

vi /etc/fstab //192.168.86.23/Share /mnt/Share cifs credentials=/user/credfile,_netdev 0 0

mount -a

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.