[jcifs] credentials while accessing the file on localhost
Michael B Allen
mba2000 at ioplex.com
Mon Mar 1 09:32:58 GMT 2004
Naved Khan said:
> I tried using smb://user:@server, smb://:@server, smb://user@server and
> smb://server/shared/. All give me the "Access denied" exception.
> Yes I use a username/password to login to my win 2000 machine. When I set
> the username and password either in the smb url string or in the
> jcifs.smb.client properties, it works fine. But my requirement was to
> shared folders using anonymous login (for shares that do not require
> user/pwd like local shares).
> I can use net use successfully without providing any credentials though:
> C:\>net use \\naved\shared
> The command completed successfully.
I believe that is bypassing the network. JCIFS cannot do that. You might
try setting jcifs.smb.client.laddr=127.0.0.1 but I think your only option
to permit anonymous logon is to enable the GUEST account. But unless you
have no other network connection and are certain no other machine has
access to yours I don't recommend it as other users will be permitted
access and a virus could more easily infect your machine.
More information about the jcifs