How do I run route during startup, even when it logs in as a user? Currently it says "SIOCADDRT: Operation not permitted" unless I log in as root.
Using MontaVista Linux on an embedded processor.
How do I run route during startup, even when it logs in as a user? Currently it says "SIOCADDRT: Operation not permitted" unless I log in as root.
Using MontaVista Linux on an embedded processor.
Make route setuid root. But you knew that, didn't you?
Um, no I didn't, I'm a newbie. But anyway, setuid() is a programming command, now that I've googled it.
So how can I do this securely? The embedded processor (naturally) uses "busybox" (route links to "busybox"). Surely I shouldn't "busybox setuid root" (not that that command works anyway!)
Can I put the route command in rc.local and then "chmod 4777" /etc/rc.d/rc.local instead? Is this safe?
Hmm may be 4755 instead of 4777. Anyway I worked it out. I have to put the route command AFTER ifconfig. Obviously.
*doh*
Normally that's the best way to do things, if the routes are static.
As for BusyBox - I'm not sure if you can have individual commands run setuid. That would be a feature of BusyBox - if it exists.
For non-static routes, dhcpd or other config manager running as root usually takes care of the routes.
Can't you just put the route command in your .../init.d/network file?
Being an embedded system, it really doesn't have a ../init.d/network file. Aaaarggghh!!! Anyway it seems to be all working now. I guess "ifconfig" deletes the routing tables, which is fair enough.
Thanks for all the help guys! Now I know how to accidently introduce security holes in the system using chmod! =)
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.