Upload a file on a file server(EC2 Instance, Platform: windows) using Node.js, SMB

0

To connect to a file server (AWS EC2 instance based on windows platform), I am using SMB protocol on my MacBook Pro. I want to connect to this file server using AWS Lambda using Node.js and pass a readable string (Buffer) to write a file on the file server. I am using SMB2 Client for Node.js to connect to the file server as

const smb2Client = new SMB2({
                    share: '\\\\IP_Address\\shared',
                    domain: 'DOMAIN',
                    username: 'USERNAME',
                    password: 'PASSWORD',
                    port: 445,
                    // debug: true,
                });

                smb2Client.readdir('Windows\\System32', (err, files) => {
                    if (err) throw err;
                    console.log(files);
                });

I am getting an error as

"Error: STATUS_LOGON_FAILURE (0xC000006D) : The attempted logon is invalid. This is either due to a bad username or authentication information. at Object.02000000 (Path/node_modules/SMB2/lib/tools/message.js:25:21) at Socket. (Path/node_modules/SMB2/lib/tools/smb2-forge.js:72:31) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at TCP.onread (net.js:597:20)"

I believe that somehow I am not able to log in using Node.js but can connect using MacBook. Can someone help me?

node.js
amazon-ec2
lambda
samba
smb
asked on Stack Overflow Nov 5, 2018 by Piyush • edited Nov 6, 2018 by Piyush

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0