3 回答

TA貢獻(xiàn)1909條經(jīng)驗 獲得超7個贊
-S The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device.
echo myPassword | sudo -S ls /tmp

TA貢獻(xiàn)1827條經(jīng)驗 獲得超9個贊
echo <password> | sudo -S <command>

TA貢獻(xiàn)1770條經(jīng)驗 獲得超3個贊
ssh-keygen Enter file in which to save the key (/home/myuser/.ssh/id_rsa): <Hit enter for default> Overwrite (y/n)? y
ssh-copy-id <remote_user>@<other_host> remote_user@other_host's password: <Enter remote user's password here>
ssh remote_user@other_host
添加回答
舉報