Home > front end >  vscode SFTP Natizyskunk permission denied, cannot modify the files and upload them
vscode SFTP Natizyskunk permission denied, cannot modify the files and upload them

Time:12-12

I use this extention in vscode for modifying files on my server: SFTP Natizyskunk

but I cannot.

this is the error:

permission denied

and this is the log:

[12-10 22:53:06] [error] Error: Permission denied
    at 101 (c:\Users\Mask\.vscode\extensions\natizyskunk.sftp-1.15.10\node_modules\ssh2\lib\protocol\SFTP.js:2618:19)
    at SFTP.push (c:\Users\Mask\.vscode\extensions\natizyskunk.sftp-1.15.10\node_modules\ssh2\lib\protocol\SFTP.js:278:11)
    at CHANNEL_DATA (c:\Users\Mask\.vscode\extensions\natizyskunk.sftp-1.15.10\node_modules\ssh2\lib\client.js:525:23)
    at 94 (c:\Users\Mask\.vscode\extensions\natizyskunk.sftp-1.15.10\node_modules\ssh2\lib\protocol\handlers.misc.js:859:16)
    at Protocol.onPayload (c:\Users\Mask\.vscode\extensions\natizyskunk.sftp-1.15.10\node_modules\ssh2\lib\protocol\Protocol.js:2025:10)
    at AESGCMDecipherNative.decrypt (c:\Users\Mask\.vscode\extensions\natizyskunk.sftp-1.15.10\node_modules\ssh2\lib\protocol\crypto.js:987:26)
    at Protocol.parsePacket [as _parse] (c:\Users\Mask\.vscode\extensions\natizyskunk.sftp-1.15.10\node_modules\ssh2\lib\protocol\Protocol.js:1994:25)
    at Protocol.parse (c:\Users\Mask\.vscode\extensions\natizyskunk.sftp-1.15.10\node_modules\ssh2\lib\protocol\Protocol.js:293:16)
    at Socket.<anonymous> (c:\Users\Mask\.vscode\extensions\natizyskunk.sftp-1.15.10\node_modules\ssh2\lib\client.js:713:21)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23) when local ➞ remote c:\laragon\www\my-shopify-app\server.php

this is my sftp config in vscode:

{
    "name": "My Server",
    "host": "51.38.125.90",
    "password": "BCwFJZLOs1Sfgguw4a77HZdV77HZ7Qgguw4aBguw4a77Hguw4a77HZdV77HZZdV77HZCwFJZLOs1Sfg7Qgguw4a77HZdV77HZdV",
    "protocol": "sftp",
    "port": 22,
    "username": "Mask",
    "remotePath": "/home/mask.mywebsite.net",
    "uploadOnSave": true,
    "useTempFile": false,
    "openSsh": true,
    "ignore":[
        ".vscode",
        ".git",
        ".DS_Store",
        ".env"
    ]
}

I use ubuntu server on my server

CodePudding user response:

I think it is easy to fix

you just don't have permission to modify the file on your server with your current user.

add the user as the directory owner:

sudo chown -R yourUsername:root yourPathDirectory

-R means recursively

after that yourUser can modify files in that directory and you won't get permission denied.

  • Related