+ -
当前位置:首页 → 问答吧 → root怎么以特殊用户身份执行一个shell

root怎么以特殊用户身份执行一个shell

时间:2011-02-17

来源:互联网

RT

作者: suntoltti   发布时间: 2011-02-17

神马特殊身份?

作者: lkk2003rty   发布时间: 2011-02-17

sudo
su

作者: cjaizss   发布时间: 2011-02-17

就是我的shell用abc ssh到另外一台机器,已经用publicKey作了信任,abc用户不用再输入密码了。

我希望我的shell放到rc.local里去,以abc身份运行。

作者: suntoltti   发布时间: 2011-02-17

回复 suntoltti


    ssh没有这种参数?

作者: 好看的附件   发布时间: 2011-02-17

回复 cjaizss


root@baltti-desktop:~# su -c /path/hello.sh - abc
密码:
abc@baltti-desktop:~$
还是让我输入密码:dizzy:

作者: suntoltti   发布时间: 2011-02-17

:em03::em03:

作者: suntoltti   发布时间: 2011-02-17

expect吧 su  密码必须从tty输入滴。。。。

作者: lkk2003rty   发布时间: 2011-02-17

谢谢大家 问题解决

su -c /path/hello.sh -l abc

放到rc.local里,重启测试正常。

作者: suntoltti   发布时间: 2011-02-17

热门下载

更多