Community discussions

MikroTik App
 
texmeshtexas
Member Candidate
Member Candidate
Topic Author
Posts: 151
Joined: Sat Oct 11, 2008 11:17 pm

sftp text file remote server

Thu May 05, 2022 5:59 am

have a RockyLinux server running OpenSSH 8.0
Trying to write a script to upload a file periodically.
RoS is 6.49.6
This command works for another server but this one on this new server gives me trouble.
The session establishes but the file transfer will not take place.
> /tool fetch url="sftp://$SecFTPservername/home/ssp" user=$SecFTPusername password=$SecFTPpassword upload=yes
ascii=yes keep-result=yes mode=ftp src-path="$Dfile.txt"
status: failed
failure: closing connection: <sftp status: 4> xx.xx.xx.xx:22 (7) (6)

Not sure if it is related to how the MT client is talking to the server or what but its clear that when channel #0 is opened the size is 0 so not data can be moved and peer shuts down connection.
Anyone run into this?

May/04/2022 20:18:00 ssh,debug comp algo CS: none,zlib@openssh.com
May/04/2022 20:18:00 ssh,debug packet follows: 0
May/04/2022 20:18:00 ssh,debug agreed on: diffie-hellman-group-exchange-sha256 ssh-rsa aes128-ctr aes128-ctr hmac-sha1 hmac-sha1 none none
May/04/2022 20:18:00 ssh,debug pki algorithm: ssh-rsa
May/04/2022 20:18:00 ssh,debug transport state: 3 --> 4
May/04/2022 20:18:00 ssh,debug requesting auth methods
May/04/2022 20:18:00 ssh,debug auth methods: publickey,gssapi-keyex,gssapi-with-mic,password
May/04/2022 20:18:00 ssh,debug doing password authorization
May/04/2022 20:18:00 ssh,debug authorized
May/04/2022 20:18:00 ssh,debug transport state: 4 --> 5
May/04/2022 20:18:00 ssh,debug channel# 0 open requested
May/04/2022 20:18:01 ssh,debug global request: hostkeys-00@openssh.com
May/04/2022 20:18:01 ssh,debug unimplemented: 80 in 4000200
May/04/2022 20:18:01 ssh,debug => offset:33 [0x21]
May/04/2022 20:18:01 ssh,debug => size:100 [0x100]
May/04/2022 20:18:01 ssh,debug 0000 026c 1050 0000 0017 686f 7374 6b65
May/04/2022 20:18:01 ssh,debug 7973 2d30 3040 6f70 656e 7373 682e 636f
May/04/2022 20:18:01 ssh,debug 6d00 0000 0197 0000 0007 7373 682d 7273
May/04/2022 20:18:01 ssh,debug 6100 0000 0301 0001 0000 0181 00cc d1df
May/04/2022 20:18:01 ssh,debug 10ad 7554 2011 d47a 32aa 9678 584e 7524
May/04/2022 20:18:01 ssh,debug 7b34 fae0 a10c f75a 7233 f185 3741 a440
May/04/2022 20:18:01 ssh,debug 5ec8 d593 4986 2bea b309 d706 dd21 b525
May/04/2022 20:18:01 ssh,debug d043 0943 457d 97bf 143f b51b 8cb3 1781
May/04/2022 20:18:01 ssh,debug 180b c822 2be1 b84a 1482 b38f 8afe 3cb1
May/04/2022 20:18:01 ssh,debug f002 238c 9328 71f2 2295 6723 4f52 45cd
May/04/2022 20:18:01 ssh,debug 6aaf 3cfb c3fc 9abc 0f1d 9426 35ff b25b
May/04/2022 20:18:01 ssh,debug b049 17fd a394 552f 9b53 739a 9a83 e59f
May/04/2022 20:18:01 ssh,debug 51ce f022 512d 5d7b a829 f52b e531 4f3e
May/04/2022 20:18:01 ssh,debug 2d0b 43a3 47b0 998a a910 fbb5 ed9b af30
May/04/2022 20:18:01 ssh,debug 566b a936 e992 9f86 50d8 6bb6 fae7 41b8
May/04/2022 20:18:01 ssh,debug c172 6ae3 4baa 4f17 d7eb db3e 76d4 a814
May/04/2022 20:18:01 ssh,debug channel #0 opened 0 w:0 p:8000 <-------------I think this is the problem. Windows size is 0
May/04/2022 20:18:01 ssh,debug channel #0 peer window exceeded
May/04/2022 20:18:01 ssh,debug channel #0 peer window consumed: 9 left: fffffff7
May/04/2022 20:18:01 ssh,debug channel #0 peer window consumed: 1f left: ffffffd8
May/04/2022 20:18:01 ssh,debug channel #0 peer window 0x1fffd8
May/04/2022 20:18:01 ssh,debug channel #0 local window consumed: d3 left: 27ff2d
May/04/2022 20:18:01 ssh,debug channel #0 check window 0x27ff2d of 280000
May/04/2022 20:18:01 ssh,debug sftp server version: 3
May/04/2022 20:18:01 ssh,debug sftp status: 4
May/04/2022 20:18:01 ssh,debug transport state: 5 --> 0
May/04/2022 20:18:01 ssh,debug closing connection: <sftp status: 4> 64.225.88.191:22 (7)
 
texmeshtexas
Member Candidate
Member Candidate
Topic Author
Posts: 151
Joined: Sat Oct 11, 2008 11:17 pm

Re: sftp text file remote server

Mon May 09, 2022 11:14 pm

Got this to work.
Had to specify a destination file name at the end of the sftp://<path>

/tool fetch url="sftp://$SecFTPservername/home/ssp/$Dfile.txt" user=$SecFTPusername password=$SecFTPpassword upload=yes
ascii=yes keep-result=yes mode=ftp src-path="$Dfile.txt"

Who is online

Users browsing this forum: Semrush [Bot] and 22 guests