Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 //192.168.1.1/share ~/share/ -o rw
cp *pdf share/
umount share/

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

share|improve this question

1 Answer 1

Either you add a mount option

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

or you write a textfile

gedit ~/.smbcredentials

with the content:

username=XYXY

password=XYXYXY

After that type

sudo chmod 600 ~/.smbcredentials

Now try mounting:

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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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