これ以上 sudo コマンドを実行できません。パスワードは許可されていません。

これ以上 sudo コマンドを実行できません。パスワードは許可されていません。

私は1年以上オンラインでUbuntuを実行しているサーバーを持っています。 root以外のユーザーを使用し、SSHキー(パスワードログインなし)を使用してSSH経由でサーバーに接続します。このユーザーは私が定期的に使用するsudoersの一部ですsu。最初からうまくいきました。私のユーザーパスワードはパスワードマネージャに保存されているので、手動で何も入力しません。

今月初めから、私のパスワードはもう許可されていません。私が実行しようとしたとき:

$ sudo -i
[sudo] password for my_user:
Sorry, try again.

3回試した後:

sudo: 3 incorrect password attempts

パスワードは変更されていません。正しいパスワードを貼り付けています。パスワードマネージャでパスワードを手動でコピーしてみました。だから別のことが起こっています。

私はまだsudoersグループのメンバーであることを確認しました。ドライブがいっぱいになっていないか、CPUが過負荷になっていることを確認しました。珍しいことはありません。私は自動更新を実行するので、Ubuntu Serverの自動更新スクリプトを実行して新しいソフトウェアを簡単にインストールできます。 Ubuntu 22.04を実行しています。

次のコマンドを実行して自分のユーザーパスワードを変更しようとした場合:

$ passwd my_user
Changing password for my_user.
Current password:
passwd: Authentication token manipulation error
passwd: password unchanged

したがって、問題はsudo自体にあるのではなく、私のユーザー認証にあるようです。

ルートで何も実行できないことを考えると、欲しいものをすべて確認することはできません。

もう少し確認してみました。この問題、含んでいる:

  • ファイルシステムは、次のように読み取り専用でマウントされていません。/proc/mounts
  • /etc/shadow権限が-rw-r-----あり、次のものです。root:shadow

sudo -lの出力:

$ sudo -l
Matching Defaults entries for my_user on lla_server:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User my_user may run the following commands on lla_server:
    (ALL : ALL) ALL

$ grep passwd /etc/nsswitch.conf
passwd:         compat systemd

$ cat /etc/pam.d/sudo
#%PAM-1.0

# Set up user limits from /etc/security/limits.conf.
session    required   pam_limits.so

session    required   pam_env.so readenv=1 user_readenv=0
session    required   pam_env.so readenv=1 envfile=/etc/default/locale user_readenv=0

@include common-auth
@include common-account
@include common-session-noninteractive

$ cat /etc/pam.d/sudo-i
#%PAM-1.0

# Set up user limits from /etc/security/limits.conf.
session    required   pam_limits.so

session    required   pam_env.so readenv=1 user_readenv=0
session    required   pam_env.so readenv=1 envfile=/etc/default/locale user_readenv=0

@include common-auth
@include common-account
@include common-session

$ su - my_user
Password: 
su: Authentication failure

$ cat /etc/pam.d/common-auth
#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
# traditional Unix authentication mechanisms.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.

# here are the per-package modules (the "Primary" block)
auth    [success=1 default=ignore]  pam_unix.so nullok
# here's the fallback if no module succeeds
auth    requisite           pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth    required            pam_permit.so
# and here are more per-package modules (the "Additional" block)
auth    optional            pam_cap.so 
# end of pam-auth-update config

何を確認できますが、この問題の原因は何ですか?ルートでは何もできないため、たとえば確認できません/var/log/auth.log

ベストアンサー1

おすすめ記事