Wednesday, July 29, 2015

SSH Connect Script without prompting for password and automatically sudo su

#!/usr/bin/expect -f
spawn ssh user@hostname
expect "assword:"
send "mypassword"
send "sudo su -\r"
interact

Rename filename Linux

mv filename_old filename_new

Add read, write and execute permissions for the owner user in Linux

chmod 700 file.sh