I would like to access and copy some files to an SMB share. These commands work with sudo, no username/password is needed:

mount.cifs // ~/share/ -o rw
cp *pdf share/
umount share/

Is there a way to do this as non-root user?


Either you add a mount option

mount.cifs // ~/share/ -o rw username=XYXY,password=XYXYXY

or you write a textfile

gedit ~/.smbcredentials

with the content:



After that type

sudo chmod 600 ~/.smbcredentials

Now try mounting:

mount.cifs // ~/share/ -o rw credentials=~/.smbcredentials

For reference: http://forums.buffalotech.com/t5/Storage/Instructions-mount-Linkstation-shares-on-Linux-system-Ubuntu/td-p/63306

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.