Ddwrt custom prompt

ddwrt custom prompt in ssh.
This post will show you a quick way to set a custom prompt when you log in to your dd-wrt router using the web-ui. The advantage of adding your scripts here is that if you don’t have permanent storage (eg a usb drive plugged in) then your commands will be executed after a re-boot (if you added a script in /tmp – the only writable area by default – then your script is lost on a re-boot)

  • goto admin > administration > commands

paste this in the box


    echo "PS1='\[\033[0;32m\]\342\224\200\342\224\200[\[\033[01;37m\]\t\[\033[0;32m\]]\342\224\200[\[\033[01;37m\]\u@\[\e[1;34m\]\h\[\033[0;32m\]]\342\224\200\342\224\200> \[\033[01;37m\]\W\[\033[0;32m\] $ \[\033[01;37m\]>>\[\033[0m\] '" > /tmp/root/.profile
    stopservice sshd
    startservice sshd
  • click ‘save startup’

– the above commands will set the root prompt, and will stop the ssh service, then restart the ssh service to enable the new prompt – you can set any custom prompts you like this way.

Sources: http://www.dd-wrt.com/wiki/index.php/Startup_Scripts

Leave a Reply