sudo: a terminal is required to read the password; either use..... 问题解决方法
转载自:sudo: a terminal is required to read the password; either use ……问题解决方法_akaiziyou的博客-CSDN博客
问题
sudo: a terminal is required to read the password; either use the -S option to read from standard in or configure an askpass helper
出现场景
某个用户在shell脚本中使用了sudo指令,此时需要为sudo命令输入密码
解决方法
1)编辑文件/etc/sudoers(以下指令拼写是正确的,请不要误认为vi应该分开)
sudo visudo
#或
sudo vim /etc/sudoers
2)找到“root ALL=(ALL) ALL”一行,在下面插入“用户 ALL=(ALL:ALL) NOPASSWD:ALL”语句,保存(需要用wq!强制退出)退出
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
2022-08-09 SQL:基本概念