OpenWrt Forum Archive

Topic: Is it possible to su to root

The content of this topic has been archived on 13 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Folks,

In order to strengthen security, I'd like to ssh to the router using anything but the user name root.  Once logged on using a non privileged user account, I would expect to "su" to root.  Here is the problem,  there is no su command on the router.  Is there some other clever way that I could achieve su'ing to root on the router, well short of getting su and compiling it ?

Regards,
  footrot.

The only thing you can do is get a binary somewhere or compile it yourself. Remember su ist part of busybox, so you would need to replace the busybox binary and make the su symlink.

Recompile busybox with su enabled. You also have to set the sticky bit on busybox binary. Use /etc/busybox.conf to configure which applets get setuid root .

You don't need to compile, recompile... just try: ssh 127.0.0.1 -l root ;)

The discussion might have continued from here.