Community discussions

MikroTik App
 
User avatar
awacenter
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Thu Dec 09, 2004 12:58 pm
Location: Castellón
Contact:

Remote Configuration with a Linux program

Fri May 06, 2005 1:31 pm

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?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26385
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Fri May 06, 2005 1:35 pm

you can do it with ssh, snmp write is not supported
 
jarosoup
Long time Member
Long time Member
Posts: 596
Joined: Sun Aug 22, 2004 9:02 am

Sat May 07, 2005 4:46 am

Are there any plans for write support?
 
User avatar
awacenter
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Thu Dec 09, 2004 12:58 pm
Location: Castellón
Contact:

Wed May 11, 2005 3:08 pm

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?
 
User avatar
YazzY
Member Candidate
Member Candidate
Posts: 140
Joined: Fri May 28, 2004 3:26 pm
Location: Norway, Østfold
Contact:

Thu May 12, 2005 12:20 pm

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/rou ... uteros.txt
AFAIR you cannot use public ssh keys with RouterOS.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26385
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Thu May 12, 2005 12:41 pm

routeros only supports user/password based authentication for ssh
 
User avatar
awacenter
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Thu Dec 09, 2004 12:58 pm
Location: Castellón
Contact:

Thu May 12, 2005 2:11 pm

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??
 
User avatar
YazzY
Member Candidate
Member Candidate
Posts: 140
Joined: Fri May 28, 2004 3:26 pm
Location: Norway, Østfold
Contact:

Fri May 13, 2005 12:19 pm

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/rou ... ervers.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

}
 
djordjez
just joined
Posts: 7
Joined: Tue Apr 05, 2005 11:35 pm
Location: Serbia
Contact:

It is a silly idea but it works! (Izgleda sasavo ali deluje)

Fri May 13, 2005 5:51 pm

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. :D
I have Fedora Core 3, haven’t tried on other linux


Pozdrav svima.

Who is online

Users browsing this forum: Bing [Bot], haung05, massinia, panzermaster18, Valerio5000, yoq and 235 guests