LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to add share to /etc/fstab with spaces in password (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-add-share-to-etc-fstab-with-spaces-in-password-4175548844/)

raphael75 07-24-2015 12:55 PM

Trying to add share to /etc/fstab with spaces in password
 
I'm trying to add a share to /etc/fstab, but the account I need to connect with has spaces in the password, and mount doesn't like it. How do I format this?

//195.212.215.32/myshare /mnt/hdrive cifs exec,iocharset=utf8,username=ralph,password=This password is very long

fatmac 07-24-2015 01:21 PM

Likely you can use a ? where the space would be, or prefix the space with \.
(Normally works for problem filenames.)

rknichols 07-24-2015 02:11 PM

Try \040 for the space characters. That's the way to represent spaces in the mount point directory name. Hopefully it works for the mount options, too.

Head_on_a_Stick 07-24-2015 05:53 PM

You could try adding the password to a file at /password in the form:
Code:

password=<password>
(Replace "<password>" with your password)

Then use this option instead of "password=":
Code:

credentials=/password
See mount.cifs(8)


All times are GMT -5. The time now is 11:12 PM.