linux shell切换用户脚本

suuser.sh

#!/bin/bash
# This is our first script.
echo 'su user[root]!'


expect -c "  
spawn su - root 
expect \":\"  
send \"Ardo@123!\r\"  
interact  
"
echo "ok!"

猜你喜欢

转载自blog.csdn.net/ardo_pass/article/details/80117420