sudo: sorry, you must have a tty to run sudo

gitlab-ci 運行sudo命令時出錯:

$ sudo cp deploy/config/stage.ini /etc/ibd-research-tool.ini
sudo: sorry, you must have a tty to run sudo

解決:

sudo vi  /etc/sudoers

# Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
#         You have to run "ssh -t hostname sudo <cmd>".
#
# Defaults    requiretty 

註釋掉Defaults    requiretty 

參考:https://my.oschina.net/fsxchen/blog/134601

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章