不幸的是我无法使用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
我能在这里做什么?
sudo被configuration为默认情况下需要一个TTY。 你可以用/etc/sudoers的以下行或/etc/sudoers.d中的include文件覆盖这个行为:
... Defaults !requiretty ...