不幸的是,我无法使用 apt-dater 连接到主机。
错误是:
Pseudo-terminal will not be allocated because stdin is not a terminal.
ADPROTO: 0.7
LSBREL: CentOS|7.2.1511|Core
VIRT: Unknown
UNAME: Linux|x86_64
FORBID: 0
sudo: sorry, you must have a tty to run sudo
ADPERR: Error executing 'sudo yum list updates' (256).
如果我使用密钥连接到服务器,c
我可以毫无问题地连接:
Script started, file is /root/.local/share/apt-dater/history/example.com:22/1460468336-14958/typescript
Last login: Tue Apr 12 15:37:08 2016 from apt-dater.example.com
CentOS 7.2.1511 x86_64
FQDN: example.com (xxx.xxx.xxx.xxx)
Processor: 8x Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz
Kernel: 4.2.8-1-pve
Memory: 4.00 GB
[apt-dater@1 ~]$ sudo yum list updates
Geladene Plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.23media.de
* epel: mirror.imt-systems.com
* extras: mirror.imt-systems.com
我可以在这里做什么?
答案1
sudo
默认配置为需要 TTY。您可以使用 中的以下行/etc/sudoers
或包含文件中的以下行覆盖此行为/etc/sudoers.d
:
...
Defaults !requiretty
...