How to mount a NAS from command line with a space in the username

0

I am trying to mount a SMB network drive from my Mac terminal. The user id is firstname lastname with a space in between. I have tried all sorts of combinations but none of these are working.

mount_smbfs //firstname\ lastname@server/home /Volumes/home

mount_smbfs //"firstname lastname"@server/home /Volumes/home

mount_smbfs //firstname" "lastname@server/home /Volumes/home

mount_smbfs //firstname\040lastname@server/home /Volumes/home

Either I am getting URL parsing failed or usage error or incorrect username (not an error but it's not able to authenticate). It however works for username with no spaces or special characters.

Is there any way this can be achieved?

Neel

Posted 2017-03-07T04:42:21.057

Reputation: 1

Have you tried: mount_smbfs //"firstname lastname"@server/home /Volumes/home? – Sir Adelaide – 2017-03-07T04:53:31.920

Yes I have tried that as well – Neel – 2017-03-07T14:24:59.167

Updated the post to include this – Neel – 2017-03-07T14:34:09.500

Apparently it works with %20 in the share name. It’s worth a try I guess! – Daniel B – 2017-03-07T14:43:33.367

Daniel - this works...

mount_smbfs //firstname%20lastname@server/home /Volumes/home

I guess because the share name combined with user id and password is parsed as a uri - so the percent encoding works

thanks – Neel – 2017-03-07T22:09:24.343

Answers

0

As Daniel B commented, substitute any space with %20.

Jan Kyu Peblik

Posted 2017-03-07T04:42:21.057

Reputation: 188

-2

Try like this:-

[root@test ProductServers]# ls -l | tail -1 drwxrwxr-x 2 nfsnobody nfsnobody 8192 Mar 6 21:04 TST Servers <-----

[root@test shares]# cd ProductServers/TST\ Servers/

biz

Posted 2017-03-07T04:42:21.057

Reputation: 29

How does this answer the question? – slhck – 2017-03-07T16:05:42.670

Did you tried this way?

mount_smbfs //firstname\ lastname/@server/home /Volumes/home – biz – 2017-03-07T16:16:40.043

1He did. It’s in the question. – Daniel B – 2017-03-07T18:08:42.673

biz - if your suggestion was to append a / at the end it did not work. The share name along with user id and password is parsed as a uri – Neel – 2017-03-07T22:12:04.460