forget ssh and use directly the ftp server service inside mikrotik:I am trying to sync firewall rules between two VRRP mikrotik and setup SSH key between them. is there any scp/sftp client available in RouterOS so i can transfer file between two mikrotik? I don't want to use ftp or third party server to transfer file between two MT.
/tool fetch mode=ftp upload=yes address=00.11.22.33 port=21 user="user" password="pax" src-path="/localfolder/localfile.rsc" dst-path="/remotefolder/remotefile.rsc" keep-result=yes;
/tool fetch mode=ftp upload=no address=00.11.232.33 port=21 user="user" password="pax" src-path="/remotefolder/remotefile.rsc" dst-path="/localfolder/localfile.rsc" keep-result=yes;
I mentioned there, I don't want to do ftp because it's not secure on wire. If RouterOS can run SSH server don't you think it should support scp client atleast?forget ssh and use directly the ftp server service inside mikrotik:I am trying to sync firewall rules between two VRRP mikrotik and setup SSH key between them. is there any scp/sftp client available in RouterOS so i can transfer file between two mikrotik? I don't want to use ftp or third party server to transfer file between two MT.
(RouterOS 6.3x.x)
for upload one file to anonther RB (with ftp service confugured):for download one file from anonther RB (with ftp service confugured):Code: Select all/tool fetch mode=ftp upload=yes address=00.11.22.33 port=21 user="user" password="pax" src-path="/localfolder/localfile.rsc" dst-path="/remotefolder/remotefile.rsc" keep-result=yes;
Code: Select all/tool fetch mode=ftp upload=no address=00.11.232.33 port=21 user="user" password="pax" src-path="/remotefolder/remotefile.rsc" dst-path="/localfolder/localfile.rsc" keep-result=yes;
The point is not hacking or brute force attack... If your two devices communicate with each other a third party can read your unencrypted credentials from wire.But ftp is the most fast and secure protocol you can use without waiting any implementation.
Simply firewall rules and/or change the default 21 port to any make impossible to hack on easy way or brute force the ftp...
It is true that FTP is not secure. Credentials and the data are passed in cleartext. However, if you're using VRRP, I would expect your routers and the cables between them to be relatively secure. If the routers and cables are secure, then capturing the traffic between these two devices seems quite unlikely. If the cables pass through unsecured areas or devices, then I share your concern. If your routers are insecure, you have bigger problems than FTP.The point is not hacking or brute force attack... If your two devices communicate with each other a third party can read your unencrypted credentials from wire.But ftp is the most fast and secure protocol you can use without waiting any implementation.
ost fast and secure protocol you can use without waiting any implementation.
Simply firewall rules and/or change the default 21 port to any make impossible to hack on easy way or brute force the ftp...
*) fetch - added SFTP support;
[admin@Mikrotik] > /system ssh user=mikrotik-upload sftp-host
Password:
This service allows sftp connections only.
Welcome back!
[admin@Mikrotik] > /tool fetch url=sftp://sftp-host/upload/test.txt user=mikrotik-upload password=xxxx
status: failed
failure: closing connection: <> 10.0.0.10:22 (16) (6)
[admin@Mikrotik] > /tool fetch upload=yes url=sftp://sftp-host/ user=mikrotik-upload password=xxxx src-path=export.rsc dst-path=upload/export.rsc
status: failed
failure: closing connection: <> 10.0.0.10:22 (17) (6)
/tool fetch upload=yes url=sftp://sftp-host/upload/export.rsc user=mikrotik-upload password=xxxx src-path=export.rsc
Match User mikrotik-upload
AuthenticationMethods password
been dealing with this lately and it does work with pub key authentication - which is superior to password. esp that password auth is disabled by default in openssh.Code: Select allMatch User mikrotik-upload AuthenticationMethods password
/tool fetch upload=yes url="sftp://serverIP/path/file" user=$user password=$password src-path=$file src-address=$ip
failure: only http[s]/sftp supports src-address
Has anyone tried to upload a file (Mikrotik router to remote server) using the src-address parameter? I'm using the following command:Code: Select all/tool fetch upload=yes url="sftp://serverIP/path/file" user=$user password=$password src-path=$file src-address=$ip
But it seems there's a bug or something because it returns this error (even the error says SFTP supports it):
Code: Select allfailure: only http[s]/sftp supports src-address
ROS Version: 6.46.5
been dealing with this lately and it does work with pub key authentication - which is superior to password. esp that password auth is disabled by default in openssh.Code: Select allMatch User mikrotik-upload AuthenticationMethods password
you can easily add private keys to the respective account in routeros, and there it is.
/tool fetch upload=yes url="sftp://192.168.120.2/backup/test.txt" src-path="test.txt" user=******** password=********
status: failed
failure: connection timeout