Can't get mount_afp to work

Hi - I have written a small script to mount the disk of another iMac running Leopard. I can mount the disk no problem using the Finder "Connect to Server..." menu option but when I try doing this from a shell script I always get an error:
sh-3.2# ./mount.sh
/Volumes/bbb hd not mounted
/bin/mkdir "/Volumes/bbb hd"
total 16
drwxrwxrwt@ 6 root admin 204 3 Oct 12:44 .
drwxrwxr-t 37 root admin 1326 29 Sep 22:02 ..
drwx------ 13 mmm staff 918 3 Oct 07:25 aaa
drwxr-xr-x 2 root admin 68 3 Oct 12:44 bbb hd
lrwxr-xr-x 1 root admin 1 3 Oct 07:24 drago hd -> /
lrwxr-xr-x 1 mmm admin 15 3 Oct 07:24 iDisk -> /Volumes/aaa
/sbin/mount_afp "afp://root:[email protected]/bbb hd" "/Volumes/bbb hd"
mount_afp: AFPMountURL returned error 1, errno is 2
Refreshing Disk Arbitration ...
As you can see the mount point is there but no matter what I try I get this error 1.
Looking on the INternet I found a few postings, mainly to do with Apple TV, and I can confirm that everything is in place:
sh-3.2# ls -al /System/Library/Filesystems
total 24
drwxr-xr-x 19 root wheel 646 12 Sep 12:09 .
drwxr-xr-x 63 root wheel 2142 28 Sep 14:46 ..
-rw-r--r--@ 1 mmm staff 6148 6 Mar 2008 .DS_Store
drwxr-xr-x 7 root wheel 238 23 Jul 05:56 AppleShare
drwxr-xr-x 7 root wheel 238 23 Jul 05:39 URLMount
lrwxr-xr-x 1 root wheel 49 23 Jul 05:36 afpfs.fs -> /System/Library/Filesystems/AppleShare/afpfs.kext
drwxr-xr-x 6 root wheel 204 24 Sep 07:12 cd9660.fs
drwxr-xr-x 3 root wheel 102 10 Jun 03:41 cddafs.fs
drwxr-xr-x 5 root wheel 170 5 Mar 2008 ftp.fs
drwxr-xr-x 5 root wheel 170 23 Jul 05:36 hfs.fs
drwxr-xr-x 4 root wheel 136 10 Jun 03:43 msdos.fs
drwxr-xr-x 3 root wheel 102 29 Nov 2007 nfs.fs
drwxr-xr-x 4 root wheel 136 10 Jun 14:29 ntfs.fs
drwxr-xr-x@ 8 root wheel 272 12 Sep 12:09 retrospectcd.fs
drwxr-xr-x 3 root wheel 102 10 Jun 14:37 smbfs.fs
drwxr-xr-x 4 root wheel 136 10 Jun 04:42 udf.fs
drwxr-xr-x 4 root wheel 136 7 Mar 2008 ufs.fs
drwxr-xr-x 4 root wheel 136 10 Jun 14:35 webdav.fs
drwxr-xr-x 4 root wheel 136 10 Jun 16:17 zfs.fs
sh-3.2# ls -al /System/Library/Filesystems/AppleShare
total 160
drwxr-xr-x 7 root wheel 238 23 Jul 05:56 .
drwxr-xr-x 19 root wheel 646 12 Sep 12:09 ..
-rwsr-xr-x 1 root wheel 38704 5 Mar 2008 afpLoad
drwxr-xr-x 3 root wheel 102 10 Jun 03:43 afpfs.kext
drwxr-xr-x 3 root wheel 102 10 Jun 04:49 asp_tcp.kext
drwxr-xr-x 3 root wheel 102 23 Jul 05:56 check_afp.app
-rwxr-xr-x 1 root wheel 38144 5 Mar 2008 sshHelper
sh-3.2# ls -al /sbin/mount_afp
-r-xr-xr-x 1 root wheel 46928 5 Mar 2008 /sbin/mount_afp
I just don't know what's wrong.
Any suggestions welcome.
Cheers
Michael

I continued my investigation and noticed that I was getting the same "error 1" message when the remote computer wasn't even switched on. This led me to believe that the mount attempt wasn't even sent to the remote computer. I did a snoop on the network i/f and there was indeed no activity when I ran this command from a root shell:
sh-3.2# /sbin/mount_afp "afp://root:[email protected]/bbb hd" "/Volumes/bbb hd"
mount_afp: AFPMountURL returned error 1, errno is 2
So I tried a different approach and ran this:
sh-3.2# /sbin/mount_afp -i "afp://[email protected]/bbb hd" "/Volumes/bbb hd"
Password:
mount_afp: AFPMountURL returned error -5023, errno is -5023
This was confirmed in the snoop log:
Data Stream Interface
Flags: Reply (0x01)
Command: Command (2)
Request ID: 3
Error code: user not authenticated (-5023)
Length: 0 bytes
Reserved: 0x00000000
I checked the destination machine and file sharing and remote login are enabled. I can ssh into the machine and username and password are correct. Yet, when trying to use mount_afp I get "user not authenticated".
Cheers
Michael

Similar Messages

Maybe you are looking for

  • GR/IR account showing open balance in FBL3N

    Hi All, There are no open GRN for booking still there is difference of amount in FBL3N. what could be the reason for showing open line item in fbl3n? Thanks chinna

  • How to remove the element with Iterators

    I have a programm like this Vector ts = new Vector(); ts.add("abc"); ts.add("abd"); Iterator it = ts.iterator(); ts.remove("abc"); it.remove(); while(it.hasNext()) { System.out.println("val = " + it.next()); } What is the problem if I use remove with

  • User input in SQL /PL-SQL

    Can I take the user input in SQL or PL/SQL please tell the procedure how can I do that suppose I am interested to get the information of the employee by respect to his age where age will be the user input (any person who will run the query prompted t

  • AD Authentication error from Infoview - BO XI R2

    We have installed BO XI R2 in a Windows 2003 Enterprise R2 environment, Our CMS is in one server and the Web Application Server is in another server in Windows 2003 Server using IIS as the web server.  We configured the CMC to use windows authenticat

  • WTK http stack implementation bug: malformed URL

    Hi the WTK emulators dont parse URLs correctly. The following code throws an "java.lang.IllegalArgumentException: malformed URL" exception. It works on most phones and the SonyEricsson J2ME SDK tho. c = (HttpConnection) Connector.open("http://www.495