Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のようなbashスクリプトを実行しようとしています。
ssh -l <username> <compname> 'sudo yum -y install expect'
エラーが発生します:
sudo: sorry, you must have a tty to run sudo
一部のコンピューターでは、プロセスはスムーズに実行されます。どうすればこれを防ぐことができますか?
フラグを使用して-t、ttyを強制的に割り当てます。
-t
ssh -t -l <username> <compname> 'sudo yum -y install expect'