Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Permisson Denied

So can you post the GUI log?

What SFTP server do you mean?
skhairuddin

Re: Permisson Denied

Yes I can upload files in GUI without any issues. Can you tell me which sftp server i can use ?
martin

Re: Permisson Denied

Can you upload the file in WinSCP GUI? Or in any other SFTP client? Show us log files for that.
skhairuddin

Permisson Denied

Hello,

I have a simple setup SFTP server is solarwinds and client is Winscp. I am trying to transfer some files using script The script is as follows.
@echo off
cd\
c:
cd "update"
 
"C:\Program Files (x86)\Winscp\Winscp.exe" "/console" /command "option batch continue" "option confirm off" "open sftp://syed:123456@sftpsrv.eastus.cloudapp.azure.com:22" "option transfer binary" "put *.txt /SFTP_Root/" "exit"

But I am getting permission, denied please check the log below.
. 2021-02-19 17:08:53.282 --------------------------------------------------------------------------
. 2021-02-19 17:08:53.282 WinSCP Version 5.5.0 (Build 3839) (OS 6.3.9600 - Windows 10 Enterprise)
. 2021-02-19 17:08:53.282 Configuration: HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2021-02-19 17:08:53.282 Local account: DESKTOP-O641TNH\Ibrahim
. 2021-02-19 17:08:53.282 Working directory: C:\update
. 2021-02-19 17:08:53.282 Process ID: 4060
. 2021-02-19 17:08:53.282 Command-line: "C:\Program Files (x86)\Winscp\Winscp.exe"  "/console" /command "option batch continue" "option confirm off" "open sftp://syed:123456@sftpsrv.eastus.cloudapp.azure.com:22" "option transfer binary" "put *.txt /SFTP_Root/" "exit"
. 2021-02-19 17:08:53.282 Time zone: Current: GMT+3, Standard: GMT+3, DST: GMT+4, DST Start: 12/30/1899, DST End: 12/30/1899
. 2021-02-19 17:08:53.282 Login time: Friday, February 19, 2021 5:08:53 PM
. 2021-02-19 17:08:53.282 --------------------------------------------------------------------------
. 2021-02-19 17:08:53.282 Script: Retrospectivelly logging previous script records:
> 2021-02-19 17:08:53.282 Script: option batch continue
< 2021-02-19 17:08:53.282 Script: batch           continue 
> 2021-02-19 17:08:53.282 Script: option confirm off
< 2021-02-19 17:08:53.282 Script: confirm         off       
> 2021-02-19 17:08:53.282 Script: open sftp://syed:***@sftpsrv.eastus.cloudapp.azure.com:22
. 2021-02-19 17:08:53.282 --------------------------------------------------------------------------
. 2021-02-19 17:08:53.282 Session name: syed@sftpsrv.eastus.cloudapp.azure.com (Modified site)
. 2021-02-19 17:08:53.282 Host name: sftpsrv.eastus.cloudapp.azure.com (Port: 22)
. 2021-02-19 17:08:53.282 User name: syed (Password: Yes, Key file: No)
. 2021-02-19 17:08:53.282 Tunnel: No
. 2021-02-19 17:08:53.282 Transfer Protocol: SFTP
. 2021-02-19 17:08:53.282 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2021-02-19 17:08:53.282 Proxy: none
. 2021-02-19 17:08:53.282 Send buffer: 262144
. 2021-02-19 17:08:53.282 SSH protocol version: 2; Compression: No
. 2021-02-19 17:08:53.282 Bypass authentication: No
. 2021-02-19 17:08:53.282 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2021-02-19 17:08:53.282 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2021-02-19 17:08:53.282 SSH Bugs: A,A,A,A,A,A,A,A,A,A
. 2021-02-19 17:08:53.282 Simple channel: Yes
. 2021-02-19 17:08:53.282 Return code variable: Autodetect; Lookup user groups: A
. 2021-02-19 17:08:53.282 Shell: default
. 2021-02-19 17:08:53.282 EOL: 0, UTF: 2
. 2021-02-19 17:08:53.282 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2021-02-19 17:08:53.282 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2021-02-19 17:08:53.282 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2021-02-19 17:08:53.282 Cache directory changes: Yes, Permanent: Yes
. 2021-02-19 17:08:53.282 DST mode: 1; Timezone offset: 0h 0m
. 2021-02-19 17:08:53.282 --------------------------------------------------------------------------
. 2021-02-19 17:08:53.282 Looking up host "sftpsrv.eastus.cloudapp.azure.com"
. 2021-02-19 17:08:53.583 Connecting to 40.87.88.67 port 22
. 2021-02-19 17:08:53.884 Server version: SSH-2.0-WeOnlyDo 2.5.5
. 2021-02-19 17:08:53.884 Using SSH protocol version 2
. 2021-02-19 17:08:53.884 We claim version: SSH-2.0-WinSCP_release_5.5
. 2021-02-19 17:08:54.038 Doing Diffie-Hellman group exchange
. 2021-02-19 17:08:54.408 Doing Diffie-Hellman key exchange with hash SHA-256
. 2021-02-19 17:08:55.362 Verifying host key rsa2 0x23,0xd0ee4c1db4460e8c a8ef2e272684bf83 6f186bde8a2d9ab2 f838bbef40a35ce3 ac15a7232238dd4d f0a35db70abe4c23 45d428da73b8bfde 12cea462529fdd89 0d9a2498c81b53d2 5b37210528ec8a18 40040b437793df41 b33f639ed31b412b 8045800a26ae1af1 d48c9a00df3836db 00cd043c6a6ee85c b7dd878a87146a6d  with fingerprint ssh-rsa 1024 4e:a8:c9:49:9b:7b:14:c4:27:76:b1:e9:a0:62:35:93
. 2021-02-19 17:08:55.362 Host key matches cached key
. 2021-02-19 17:08:55.362 Host key fingerprint is:
. 2021-02-19 17:08:55.362 ssh-rsa 1024 4e:a8:c9:49:9b:7b:14:c4:27:76:b1:e9:a0:62:35:93
. 2021-02-19 17:08:55.362 Initialised AES-256 SDCTR client->server encryption
. 2021-02-19 17:08:55.362 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2021-02-19 17:08:55.498 Initialised AES-256 SDCTR server->client encryption
. 2021-02-19 17:08:55.498 Initialised HMAC-SHA-256 server->client MAC algorithm
! 2021-02-19 17:08:55.645 Using username "syed".
. 2021-02-19 17:08:55.799 Prompt (7, SSH password, , &Password: )
. 2021-02-19 17:08:55.799 Using stored password.
. 2021-02-19 17:08:55.799 Sent password
. 2021-02-19 17:08:55.946 Access granted
. 2021-02-19 17:08:55.946 Opening session as main channel
. 2021-02-19 17:08:56.084 Opened main channel
. 2021-02-19 17:08:56.432 Started a shell/command
. 2021-02-19 17:08:56.432 --------------------------------------------------------------------------
. 2021-02-19 17:08:56.432 Using SFTP protocol.
. 2021-02-19 17:08:56.432 Doing startup conversation with host.
> 2021-02-19 17:08:56.432 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2021-02-19 17:08:56.764 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2021-02-19 17:08:56.764 SFTP version 3 negotiated.
. 2021-02-19 17:08:56.764 We believe the server has signed timestamps bug
. 2021-02-19 17:08:56.764 We will use UTF-8 strings when appropriate
. 2021-02-19 17:08:56.764 Getting current directory name.
. 2021-02-19 17:08:56.764 Getting real path for '.'
> 2021-02-19 17:08:56.764 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2021-02-19 17:08:56.918 Type: SSH_FXP_NAME, Size: 23, Number: 16
. 2021-02-19 17:08:56.918 Real path is '/'
. 2021-02-19 17:08:56.918 Startup conversation with host finished.
< 2021-02-19 17:08:56.918 Script: Active session: [1] syed@sftpsrv.eastus.cloudapp.azure.com
> 2021-02-19 17:08:56.918 Script: option transfer binary
< 2021-02-19 17:08:56.918 Script: transfer        binary   
> 2021-02-19 17:08:56.918 Script: put *.txt /SFTP_Root/
. 2021-02-19 17:08:56.918 Copying 4 files/directories to remote directory "/SFTP_Root/"
. 2021-02-19 17:08:56.918   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: N (102400); CalcS: No; Mask:
. 2021-02-19 17:08:56.918   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM:
. 2021-02-19 17:08:56.918   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2021-02-19 17:08:56.918 File: 'InventoryMovement.txt' [2021-02-18T04:17:16.021Z] [2046150]
. 2021-02-19 17:08:56.918 Copying "InventoryMovement.txt" to remote directory started.
. 2021-02-19 17:08:56.918 Binary transfer mode selected.
. 2021-02-19 17:08:56.918 Opening remote file.
> 2021-02-19 17:08:56.918 Type: SSH_FXP_OPEN, Size: 57, Number: 259
< 2021-02-19 17:08:57.066 Type: SSH_FXP_STATUS, Size: 34, Number: 259
< 2021-02-19 17:08:57.066 Status code: 3, Message: 259, Server: Permission denied, Language: 
> 2021-02-19 17:08:57.066 Type: SSH_FXP_LSTAT, Size: 41, Number: 519
< 2021-02-19 17:08:57.266 Type: SSH_FXP_STATUS, Size: 29, Number: 519
< 2021-02-19 17:08:57.266 Status code: 2, Message: 519, Server: No such file, Language: 
* 2021-02-19 17:08:57.266 (ETerminal) Permission denied.
* 2021-02-19 17:08:57.266 Error code: 3
* 2021-02-19 17:08:57.266 Error message from server: Permission denied
. 2021-02-19 17:08:57.266 Asking user:
. 2021-02-19 17:08:57.266 Cannot create remote file '/SFTP_Root/InventoryMovement.txt'. ("Permission denied.
. 2021-02-19 17:08:57.266 Error code: 3
. 2021-02-19 17:08:57.266 Error message from server: Permission denied")
< 2021-02-19 17:08:57.266 Script: Cannot create remote file '/SFTP_Root/InventoryMovement.txt'.
< 2021-02-19 17:08:57.266 Script: Permission denied.
< 2021-02-19 17:08:57.266 Error code: 3
< 2021-02-19 17:08:57.266 Error message from server: Permission denied
* 2021-02-19 17:08:57.266 (EScpSkipFile) Cannot create remote file '/SFTP_Root/InventoryMovement.txt'.
* 2021-02-19 17:08:57.266 Permission denied.
* 2021-02-19 17:08:57.266 Error code: 3
* 2021-02-19 17:08:57.266 Error message from server: Permission denied
. 2021-02-19 17:08:57.266 File: 'ItemCurrentStock.txt' [2021-02-18T04:17:16.036Z] [616722]
. 2021-02-19 17:08:57.266 Copying "ItemCurrentStock.txt" to remote directory started.
. 2021-02-19 17:08:57.266 Binary transfer mode selected.
. 2021-02-19 17:08:57.266 Opening remote file.
> 2021-02-19 17:08:57.266 Type: SSH_FXP_OPEN, Size: 56, Number: 771
< 2021-02-19 17:08:58.694 Type: SSH_FXP_STATUS, Size: 34, Number: 771
< 2021-02-19 17:08:58.694 Status code: 3, Message: 771, Server: Permission denied, Language: 
> 2021-02-19 17:08:58.694 Type: SSH_FXP_LSTAT, Size: 40, Number: 1031
< 2021-02-19 17:08:58.888 Type: SSH_FXP_STATUS, Size: 29, Number: 1031
< 2021-02-19 17:08:58.888 Status code: 2, Message: 1031, Server: No such file, Language: 
* 2021-02-19 17:08:58.888 (ETerminal) Permission denied.
* 2021-02-19 17:08:58.888 Error code: 3
* 2021-02-19 17:08:58.888 Error message from server: Permission denied
. 2021-02-19 17:08:58.888 Asking user:
. 2021-02-19 17:08:58.888 Cannot create remote file '/SFTP_Root/ItemCurrentStock.txt'. ("Permission denied.
. 2021-02-19 17:08:58.888 Error code: 3
. 2021-02-19 17:08:58.888 Error message from server: Permission denied")
< 2021-02-19 17:08:58.888 Script: Cannot create remote file '/SFTP_Root/ItemCurrentStock.txt'.
< 2021-02-19 17:08:58.888 Script: Permission denied.
< 2021-02-19 17:08:58.888 Error code: 3
< 2021-02-19 17:08:58.888 Error message from server: Permission denied
* 2021-02-19 17:08:58.888 (EScpSkipFile) Cannot create remote file '/SFTP_Root/ItemCurrentStock.txt'.
* 2021-02-19 17:08:58.888 Permission denied.
* 2021-02-19 17:08:58.888 Error code: 3
* 2021-02-19 17:08:58.888 Error message from server: Permission denied
. 2021-02-19 17:08:58.888 File: 'SalesTransactions.txt' [2021-02-18T04:17:16.052Z] [3729072]
. 2021-02-19 17:08:58.888 Copying "SalesTransactions.txt" to remote directory started.
. 2021-02-19 17:08:58.888 Binary transfer mode selected.
. 2021-02-19 17:08:58.888 Opening remote file.
> 2021-02-19 17:08:58.888 Type: SSH_FXP_OPEN, Size: 57, Number: 1283
< 2021-02-19 17:08:59.026 Type: SSH_FXP_STATUS, Size: 34, Number: 1283
< 2021-02-19 17:08:59.026 Status code: 3, Message: 1283, Server: Permission denied, Language: 
> 2021-02-19 17:08:59.026 Type: SSH_FXP_LSTAT, Size: 41, Number: 1543
< 2021-02-19 17:08:59.174 Type: SSH_FXP_STATUS, Size: 29, Number: 1543
< 2021-02-19 17:08:59.174 Status code: 2, Message: 1543, Server: No such file, Language: 
* 2021-02-19 17:08:59.174 (ETerminal) Permission denied.
* 2021-02-19 17:08:59.174 Error code: 3
* 2021-02-19 17:08:59.174 Error message from server: Permission denied
. 2021-02-19 17:08:59.174 Asking user:
. 2021-02-19 17:08:59.174 Cannot create remote file '/SFTP_Root/SalesTransactions.txt'. ("Permission denied.
. 2021-02-19 17:08:59.174 Error code: 3
. 2021-02-19 17:08:59.174 Error message from server: Permission denied")
< 2021-02-19 17:08:59.174 Script: Cannot create remote file '/SFTP_Root/SalesTransactions.txt'.
< 2021-02-19 17:08:59.174 Script: Permission denied.
< 2021-02-19 17:08:59.174 Error code: 3
< 2021-02-19 17:08:59.174 Error message from server: Permission denied
* 2021-02-19 17:08:59.189 (EScpSkipFile) Cannot create remote file '/SFTP_Root/SalesTransactions.txt'.
* 2021-02-19 17:08:59.189 Permission denied.
* 2021-02-19 17:08:59.189 Error code: 3
* 2021-02-19 17:08:59.189 Error message from server: Permission denied
. 2021-02-19 17:08:59.189 File: 'TenderSalesTransactions.txt' [2021-02-18T04:17:16.052Z] [2874]
. 2021-02-19 17:08:59.189 Copying "TenderSalesTransactions.txt" to remote directory started.
. 2021-02-19 17:08:59.189 Binary transfer mode selected.
. 2021-02-19 17:08:59.189 Opening remote file.
> 2021-02-19 17:08:59.189 Type: SSH_FXP_OPEN, Size: 63, Number: 1795
< 2021-02-19 17:08:59.343 Type: SSH_FXP_STATUS, Size: 34, Number: 1795
< 2021-02-19 17:08:59.343 Status code: 3, Message: 1795, Server: Permission denied, Language: 
> 2021-02-19 17:08:59.343 Type: SSH_FXP_LSTAT, Size: 47, Number: 2055
< 2021-02-19 17:08:59.490 Type: SSH_FXP_STATUS, Size: 29, Number: 2055
< 2021-02-19 17:08:59.490 Status code: 2, Message: 2055, Server: No such file, Language: 
* 2021-02-19 17:08:59.490 (ETerminal) Permission denied.
* 2021-02-19 17:08:59.490 Error code: 3
* 2021-02-19 17:08:59.490 Error message from server: Permission denied
. 2021-02-19 17:08:59.490 Asking user:
. 2021-02-19 17:08:59.490 Cannot create remote file '/SFTP_Root/TenderSalesTransactions.txt'. ("Permission denied.
. 2021-02-19 17:08:59.490 Error code: 3
. 2021-02-19 17:08:59.490 Error message from server: Permission denied")
< 2021-02-19 17:08:59.490 Script: Cannot create remote file '/SFTP_Root/TenderSalesTransactions.txt'.
< 2021-02-19 17:08:59.490 Script: Permission denied.
< 2021-02-19 17:08:59.490 Error code: 3
< 2021-02-19 17:08:59.490 Error message from server: Permission denied
* 2021-02-19 17:08:59.497 (EScpSkipFile) Cannot create remote file '/SFTP_Root/TenderSalesTransactions.txt'.
* 2021-02-19 17:08:59.497 Permission denied.
* 2021-02-19 17:08:59.497 Error code: 3
* 2021-02-19 17:08:59.497 Error message from server: Permission denied
> 2021-02-19 17:08:59.497 Script: exit
. 2021-02-19 17:08:59.497 Script: Exit code: 0
. 2021-02-19 17:08:59.497 Closing connection.
. 2021-02-19 17:08:59.497 Sending special code: 12
. 2021-02-19 17:08:59.497 Sent EOF message