User Tools

Site Tools


root_script

Root Login

Ideally to be placed in /usr/local/bin/ otherwise path to r.sh file to be adjusted:

r.sh will be looking like:

#!/usr/bin/expect
set echo off
spawn su -
expect Password:
send “rootpassword\r”
expect *
send “clear\r”
expect *
send “cat /usr/local/bin/motd.txt\r”
interact

alias to “r” key to be created by editing “.bashrc” followed by “source .bashrc”:

alias r='/usr/local/bin/r.sh'

root_script.txt · Last modified: 2016/11/16 15:37 by neo