Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-24-2015, 12:55 PM   #1
Registered: Jul 2012
Posts: 37

Rep: Reputation: Disabled
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?

// /mnt/hdrive cifs exec,iocharset=utf8,username=ralph,password=This password is very long
Old 07-24-2015, 01:21 PM   #2
Senior Member
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: AntiX.
Posts: 1,825

Rep: Reputation: Disabled
Likely you can use a ? where the space would be, or prefix the space with \.
(Normally works for problem filenames.)
Old 07-24-2015, 02:11 PM   #3
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 3,400

Rep: Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487
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.
Old 07-24-2015, 05:53 PM   #4
Senior Member
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 283Reputation: 283Reputation: 283
You could try adding the password to a file at /password in the form:
(Replace "<password>" with your password)

Then use this option instead of "password=":
See mount.cifs(8)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] editing fstab - mount point with spaces vincix Linux - Newbie 5 11-23-2012 04:09 AM
[SOLVED] can mount WinXP share but not Win7 share in fstab dodgefan Linux - Server 9 06-13-2010 07:45 PM
Problem - Samba path in fstab has spaces for my WindowsXP machine ylikone Linux - Networking 2 08-01-2006 09:02 AM
smbfs, fstab, spaces in the folder i want to mount. Problems! JapanFred Linux - Networking 1 12-29-2005 03:27 PM
fstab and a password containing spaces kodiakmook Linux - General 2 05-15-2002 11:36 AM

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration