Manual:IP/SSH: Difference between revisions
Line 91: | Line 91: | ||
==Example== | ==Example== | ||
To use forwarding | |||
'''Remote forwarding''' | |||
To use remote forwarding from Linux host using OpenSSH client type in following command: | |||
ssh reamoteuser@remotehost -L port:remotehost:remoteport | ssh reamoteuser@remotehost -L port:remotehost:remoteport | ||
where: | where: | ||
*remoteuser - | *remoteuser - username on the router | ||
*remotehost - | *remotehost - routers address (router should be able to resolve host name if address is not an IP address) | ||
*port - local port that your host will listen on | *port - local port that your host will listen on | ||
*remoteport - port on the router | *remoteport - port on the router | ||
Line 107: | Line 110: | ||
{{Note|we fully support SFTP v3 as described in [http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-02.txt draft-ietf-secsh-filexfer-02.txt] other versions can cause problems}} | {{Note|we fully support SFTP v3 as described in [http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-02.txt draft-ietf-secsh-filexfer-02.txt] other versions can cause problems}} | ||
'''Local Forwarding ''' | |||
<pre> | |||
ssh -N -D <local_port> -l <user> <remote_address> | |||
</pre> | |||
Where: | |||
* local_port - local port that your host will listen on | |||
* user - username on the router | |||
* remote_address - routers address | |||
For example: | |||
<pre> | |||
ssh -N -v -D 9999 -l admin 192.168.88.1 | |||
</pre> | |||
Now you can use local port 9999 to fetch files: | |||
<pre> | |||
curl -x socks5h://localhost:9999 https://download.mikrotik.com/routeros/winbox/3.18/winbox.exe | |||
</pre> | |||
[[Category:Manual|T]] [[Category:IP|T]] [[Category:Console|S]] | [[Category:Manual|T]] [[Category:IP|T]] [[Category:Console|S]] |
Revision as of 10:01, 9 April 2019
Applies to RouterOS: v5
Summary
This menu controls if ssh server behaviour regarding port forward and authentication methods.
Settings
Property | Description |
---|---|
allow-none-crypto (yes|no; Default: yes) | Whether to allow connection if cryptographic algorithms are set to none. |
always-allow-password-login (yes | no; Default: no) | Whether to allow password login at the same time when public key authorization is configured. |
forwarding-enabled (both | local | no | remote; Default: remote) | Allows to control which SSH forwarding method to allow:
|
host-key-size (yes | no; Default: no) | What RSA key size to use when host key is being regenerate regenerated. |
strong-crypto (yes | no; Default: no) | Use stronger encryption, HMAC algorithms, use bigger DH primes and disallow weaker ones:
|
Commands
Property | Description |
---|---|
export-host-key (key-file-prefix) | Export public and private RSA/DSA keys to files. Command takes one parameter:
|
import-host-key (private-key-file) | Import and replace private DSA/RSA key from specified file. Command takes one parameter:
|
regenerate-host-key () | Generated new and replace current set of private keys (DSA, RSA) on the router. Be aware that previously imported keys might stop working. |
Note: When connecting from RouterOS built in client to router with strong crypto disabled, temporary strong crypto must be disabled on connecting router too. Reason is that strong crypto forces algorithms which are not supported when this feature is disabled.
Example
Remote forwarding
To use remote forwarding from Linux host using OpenSSH client type in following command:
ssh reamoteuser@remotehost -L port:remotehost:remoteport
where:
- remoteuser - username on the router
- remotehost - routers address (router should be able to resolve host name if address is not an IP address)
- port - local port that your host will listen on
- remoteport - port on the router
If user requires telnet to router, but you do not want to allow it to be plain text, Following can be done:
ssh admin@192.168.88.1 -L 3000:192.168.88.1:23
now when user uses telnet localhost 3000" it will log in the router using telnet over encrypted tcp connection.
Note: we fully support SFTP v3 as described in draft-ietf-secsh-filexfer-02.txt other versions can cause problems
Local Forwarding
ssh -N -D <local_port> -l <user> <remote_address>
Where:
- local_port - local port that your host will listen on
- user - username on the router
- remote_address - routers address
For example:
ssh -N -v -D 9999 -l admin 192.168.88.1
Now you can use local port 9999 to fetch files:
curl -x socks5h://localhost:9999 https://download.mikrotik.com/routeros/winbox/3.18/winbox.exe