每次进去Linux系统,都有切换root用户,输入密码很麻烦,所以就写了一个小脚本,自动输入密码,登录到root用户, 1,首先检查一些是否安装了expect root@wuzs:/home/wuzs# whereis expect expect: /usr/bin/expect /usr/share/man/man1/expect.1.gz 如果没有需要安装一下 apt install expect 2,代码如下 root@wuzs:/home/wuzs# cat suroot.sh #!/u