I think I found a bug:
Basically I think the user flag in the /system ssh command is not working
and it also doesn’t auto complete with available options
ssh admin@192.168.88.1
[admin@MikroTik] > system ssh myhost user=ubuntu
Welcome back!
ssh from routeros not working
scenario 2:
ssh ubuntu@192.168.88.1
[ubuntu@MikroTik] > system ssh myhost
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-1083-aws x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
135 packages can be updated.
0 updates are security updates.
New release '18.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: *****
ubuntu@ip-*****:~$
user parameter is used to specify remote user name, not the local one. Hence no autocomplete - no way for your mikrotik to obtain user list from remote system.
The whole concept of using keys to authenticate ssh users to remote systems is that each local (in this case, Mikrotik) user has his “personal” key which he uses to authenticate himself as he connects to any remote system. To use the user parameter of /system ssh would break the idea that each user can only use its own “identity” (represented by the key) to authenticate himself to the remote system.
So the correct approach is to create own key for each Mikrotik user which will be connecting to some user account on the remote server, and deliver the public keys of all the users to the remote server for access to those of its user accounts which should accept it.
The only purpose of the user parameter of /system ssh is to set the remote user name; by omitting it you tell the system to use the local user name for this purpose.
You guessed it right
If you are logged in to RouterOS with local user “ubuntu”, then you have access to the private ssh key, with which you can then login to any (linux, RouterOS, other) host if that ssh key is authorized to log in.
If you are logged in to RouterOS with another user (like admin), then you are not using the private key, which is only available to the RouterOS user you previously imported it to.