ardean/smb2

Unable to connect to Window's network attached storage share

SHAPPY0 opened this issue · 0 comments

Hi,
I'm trying to connect to Network attached storage(NAS share)

const smb2 =  require("@stifani/smb2");
const client = new smb2.Client(config.host);
const session = await client.authenticate({
  domain:config.domain
  username:config.username
  password : config.password
});
const tree = await session.connectTree(config.sharepath);

but its throwing me an error object -


Response {
    header:{
        protocolId:'fe53d42',
        structureSize:64,
        creditCharge:0,
        status:3221225676,
        type:3,
        credit:1,
        flags:1,
        nextCommand:0,
        messageId:3n,
        clientId:'00000000',
        treeId:0,
        sessionId:'0ca0530000000abe',
        signature:0
    },
    body:{
        structureSize:9,
        shareType:0,
        reserved:0,
        shareFlags:0,
        capabilities:0,
        maximalAccess:0
    },
    typeName: 'TreeConnect',
    request: Request {
        header:{
            messageId :3n,
            clientId: 'ea45b4b7',
            sessionId: '0ca0530000000abe',
            treeId: undefined,
            type: 3
        },
        body:{
            buffer: <Buffer 5c 00 5c 00 6e 00 61 00 73 00 76 00 30 00 36 00 30 00 31 00 3a 00 34 00 34 00 35 00 5c 00 5c 00 62 00 63 00 6d 00 5f 00 64 00 61 00 74 00 61 00 5f 00 ... 28 more bytes>
        },
        typeName: 'TreeConnect'
    }
}

Can someone please confirm me where is the issue, if its in my code then please help me to fix it.

Thanks