Remote Configuration with a Linux program

Hi people,

I read the MT documentation carefully, above all the SNMP protocol and SSH server. I want my shell program in LINUX have access to configure MT, they are able to modify MT attributes.

But I have several problems: in the first case, SNMP protocol can ‘write’ in MT configuration. It is only enabled read access; in the second case, MT SSH server can not create a key for sending to the LINUX account.

So, How can my LINUX programs modify MT configuration?

you can do it with ssh, snmp write is not supported

Are there any plans for write support?

My problem is I can not execute the command ssh-keygen in MT since I want to access from a LINUX to MT.

I don’t know where to save the file in the another case: MT access to my LINUX.

How can I generate keys in MT? the public one? And the ~/.ssh/authorized_keys file?

You can execute commands on MT remotely with telnet or ssh.
All you actually need for that is expect.
I wrote a dialog based menu for that which should give you an idea how to do that:
http://yazzy.yazzy.org/coding/shell/routeros/routeros.txt
AFAIR you cannot use public ssh keys with RouterOS.

routeros only supports user/password based authentication for ssh

ohh!! So, I have a BIG problem because I would like to use SSH tunnel with public keys to control and modify the configuration of 750 MT.
What can I do??

Don't use SSH tunneling, you were told at least twice it will not work with public SSH keys.
Rather run your commands from a cronjob or each time you want to perform them from e.g website.
You will be able to connect remotely to your routers listed in the servers.txt file (http://yazzy.yazzy.org/coding/shell/routeros/servers.txt) with ssh and perform any commands given in the COMMAND variable without public SSH key, just like in my script.
Write your own script with a for loop which will connect to all your boxes in the list and perform given commands if needed.

connect_ssh() {

echo '
spawn '${SSH}' '${ROUTER}' -l '${USER}'
expect -re "password: "
send "'${PASS}'\r"

expect -re "] > "
send "'${COMMAND}'\r"
sleep 2

expect -re "] > " exit
' > ${TMPFILE}

${EXPECT} ${TMPFILE}

rm -rf ${TMPFILE}
echo ""
exit 0

}

I tried this and it worked like a charm.
You just need winbox.exe, you run it with WINE and there you go you have remote config. tool for Linux. :smiley:
I have Fedora Core 3, haven’t tried on other linux


Pozdrav svima.