tyro
tyro

Reputation: 795

trying to understand how does SMB work

I'm trying to create a file on shared location and write the string which is being passed to it. All this I'm doing as shown below,

String user = "abcd:XXXXX";
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(user);
String path = "smb://smb/ds/TESTING_GOING_ON/test.txt";
SmbFile sFile = new SmbFile(path,auth);
try (SmbFileOutputStream sfos = new SmbFileOutputStream(sFile)) {
    sfos.write(str.getBytes());
    sfos.close();
}

Its working fine, this I'm trying to do from Windows to shared drive(which os I dont know.)

I'm trying to understand how does smb works, that's why I read the document what is SMB.

But I'm not able to map here if above code is running fine then,

which is SMBclient(Is this my windows machine as stated in the document "Microsoft Windows for Workgroups 3.x")

What is acting as SMB server?

Not able to get clear idea about it.

Any help would be really appreciated. Thank you.

I'm trying to get deep into this because, the above code works fine for local windows 7 machine but not working on cloud environment which is linux.

Also, If there is network access that needs to be provided from cloud environment then, what all information do I need to have before going to network department for access. for eg. which port the connection open etc. and I don't know what other information I will need to make it happen

Upvotes: 0

Views: 565

Answers (1)

inaki
inaki

Reputation: 1

Could you give some more information please?

Assuming your program is written Java, how do you execute it on Windows and how is it ran in Linux? Which Linux distribution is running on your linux box? What happens on your linux box when the program is not working as expected?

As Java code should be cross platform, it might be usefull to check if you have the right java runtime installed on your linux box. Which java related packages are installed?

The document you are using to read up on Samba was last updated in 2002, it might be usefull to check for some more recent documentation, eg. samba wiki

Upvotes: 0

Related Questions