Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins call to mount_smbfs fails with Authentication error

I am running Jenkins on Mac OS X 10.7.5 and have it handle nightly backup to a SMB share on a Windows server. I want to mount the SMB drive automatically as part of the backup script but mount_smbfs fails from within Jenkins. The mount command I use is of the form:

mount_smbfs "//WORKGROUP;user:password@server/share" /Users/user/share

This works fine from the Terminal command line but in Jenkins gives me the error:

mount_smbfs: server rejected the connection: Authentication error

I have made sure that Jenkins runs the command as the same user as on the command line and nothing stood out in the differences in the PATH and other environment variables.

like image 487
MarkMizuguchi Avatar asked Jan 04 '13 18:01

MarkMizuguchi


1 Answers

This is not a complete answer yet - just a list of information relevant for the diagnosis. Please edit this answer if you find any proper therapy.

Here are some relevant Apple support articles:

  • http://support.apple.com/kb/HT1568
  • http://support.apple.com/kb/HT4829

and these are the man pages

  • man mount_smbfs
  • man smbutil
  • man nsmb.conf

You might want to try out smbutil view "/WORKGROUP;user:password@server"

to check the availabilty of the server.

the -N option of the mount_smbfs command is good for automating the login process

   -N      Do not ask for a password.  At run time, mount_smbfs reads the
             ~/Library/Preferences/nsmb.conf file for additional configuration parameters
             and a password.  If no password is found, mount_smbfs prompts for it.

There is also the question of plaintext or encrypted passwords addressed at:

  • http://hints.macworld.com/article.php?story=20050506120948120
like image 99
Wolfgang Fahl Avatar answered Nov 15 '22 07:11

Wolfgang Fahl