ppp profile -> scripts .... run as certain user

Hello

In ppp profile->scripts there is a possibility to run script “On up” / “On down”
Which Mikrotik User is running/executing the script code there ?

i have a special user (“root”) for a ssh (Key based) call to an raspian like

/system ssh xxx.xxx.xxx.xxx user=root

This works only ssh key based when i am looged in as “root”

So how i can ran the script in ppp profile as user “root” ?

Richard

That cannot be done. You even cannot start ssh sessions from a script.

i want to deploy a ssh comand … not possible ?
richard

No. But there are other tricks you can use.
E.g. you can setup the Linux machine as a network syslog server on the MikroTik (always a good thing to do!) and send a /log line to the log in the ppp-up, then in the Linux machine setup syslogd to take action on receiving that log line.

ok thx !
i will try this way :slight_smile:
richard

What is your goal with this? why call the PI?

ssh-exec has been added in 6.45.1 (http://forum.mikrotik.com/t/v6-45-1-stable-is-released/131227/1), and CAN be called from scripts!

Ah ok, I did not notice that… and it is not even completely documented in the wiki yet.
Apparently parameters are:

/system ssh-exec 
output-to-file  port  routing-table  src-address  user  address  command

So maybe it just works when user=root is specified.

search function helps: https://wiki.mikrotik.com/wiki/Manual:System/SSH_client#SSH-exec (but not a lot yet…)

i want to reboot the raspian via ssh when OVPN was down/up...... comand ist "/sbin/reboot"
so ican execute the script in ppp profile as user root ?

Richard