长期潜水,第一次发帖。
我的 Linux 服务器行为异常。当我运行 时sudo passwd
,我可以正确设置密码。但是,如果我运行sudo chsh -s /bin/bash
,命令会返回错误:
chsh: PAM: Authentication failure
当我运行时sudo echo "hi"
,我得到以下输出:
hi
如果需要,我可以提供更多详细信息。我已重复此步骤三次,并且我 100% 确定我输入的密码正确。
$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
谢谢你!
答案1
我是个傻瓜
$ sudo passwd alexander
You can now choose the new password or passphrase.
A valid password should be a mix of upper and lower case letters,
digits, and other characters. You can use a 12 character long
password with characters from at least 3 of these 4 classes, or
an 8 character long password containing characters from all the
classes. An upper case letter that begins the password and a
digit that ends it do not count towards the number of character
classes used.
A passphrase should be of at least 3 words, 16 to 40 characters
long, and contain enough different characters.
Alternatively, if no one else can see your terminal now, you can
pick this as your password: "claw5Met8sword".
Enter new password:
Re-type new password:
passwd: password updated successfully
其次是
$ chsh -s /bin/bash