I am trying to copy a file from MAC to windows using mount_smbfs. However, I am getting an authentication error. It says "server rejected connection: authentication error". I am writing the correct username and password but the problem did not change. Here is my code below.
NSTask* task = [[NSTask alloc] init];
[task setLaunchPath:@"/sbin/mount_smbfs"];
[task setArguments:[NSArray arrayWithObjects:@"//user:50000@smb://192.168.2.1/Share",@"/Users/Shared", nil]];
[task launch];
Could you please help how can I solve this problem?
From this page - you need to specify the workgroup as part of the connection, otherwise you always get the authentication error.
so the connection string should be:
//WORKGROUP;user:[email protected]/Share
... assuming that the 50000 is the password for the user user
Bear in mind that it's an URL that you're using, so make sure to URL-escape the username and the password before embedding them in the string, otherwise they could be misinterpreted.
If you're connecting to non-domain joined systems, then the WORKGROUP value is pretty much arbitrary, and tends to be ignored for the connection. It may matter for domain-joined systems, because the username is a DOMAIN\username but when you're connecting to non-domain systems the DOMAIN\ part is ignored when checking user credentials.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With