浅见池也 发表于 2018-8-25 10:07:59

CentOS 6.5 shell中su切换自动输入密码

  yum -y install expect
  login as normal user:
  vi su.exp
  #!/usr/bin/expect
  set timeout 30
  spawn su -
  expect "Password:"
  send "root-pass\r"
  interact
  chmod +x su.exp
  ./su.exp

页: [1]
查看完整版本: CentOS 6.5 shell中su切换自动输入密码