BSUK
BSUK

Reputation: 745

Mount command failing on 10.7.5

I have a shell script that mounts an smb share. It works perfectly on all macs with every OS revision except 10.7.5 The offending command is simply:

mount -t smbfs -o nobrowse //test:test@servername/sharename /my/mnt/point

When I attempt this command on a 10.7.5 mac, it fails either with a "broken pipe" or "authentication failed" error. However, it works fine on macs running 10.7.4, 10.6, 10.8 etc.

Can anyone successfully use this command on 10.7.5? Is there any alternative way of achieving this, or troubleshooting exactly why this error is happening? I'm running out of ideas!

Upvotes: 0

Views: 2190

Answers (2)

Armali
Armali

Reputation: 19395

Since feature requests to mark a comment as an answer remain declined, I copy the above solution here.

Thanks for the replies. The problem was two fold: firstly, for some reason you cannot run this command as root in 10.7.5, and secondly you cannot mount outisde of /Volumes. Strangely this seems to work in all other OS revisions. I have worked around this problem by mounting my share in /Volumes and then creating a sym link to the desired mount point:

mkdir -p /Volumes/share 
sudo -u localadminuser mount -t smbfs -o nobrowse //user:pass@server/share /Volumes/share 
ln -s /Volumes/share /location/that/I/prefer/to/mnt 

I hope this helps someone out. No idea why 10.7.5 changes this. – BSUK

Upvotes: 1

Anya Shenanigans
Anya Shenanigans

Reputation: 94849

There are many reasons why the mount will not work. Some of the reasons include:

  • Time between server and client being too different
  • Workgroup name not specified on the mac
  • Local hostname uses non-latin characters
  • Encryption is too strict between the mac and the server

To solve the time; set the time.

I've seen broken pipe/authentication errors most often when you don't use a workgroup name for the connection. A connection string looking like generally works better than one without any workgroup:

//WORKGROUP;user:[email protected]/Share

... assuming that the 50000 is the password for the user user should allow the connection. Generally, you just need to have a string before the semi-colon, it can read anything; it just needs to be there.

To solve the local hostname issue click on an interface, choose advanced go to the WINS tab and make sure that the name doesn't have any foreign characters there.

If the encryption is too strict, you will need to edit the nsmb.conf. I have a set of lines looking like:

[server1]
minauth=none

for an ancient BSD server which cannot deal with encrypted passwords. You can have this in either an /etc/nsmb.conf or ~/Library/Preferences/nsmb.conf file.

This may not address your issue, but it may help you in trying to proceed.

Unfortunately, saying it works on box x and not on box y doesn't really help, as there could be any arbitrary configuration difference between them.

Upvotes: 1

Related Questions