我无法安装 OpenSSH 服务器。
我的安装命令:
sudo apt-get install openssh-server
我收到以下错误:
原始输出错误:
chage: /etc/passwd.15967: Permission denied
chage: cannot lock /etc/passwd.trY again leter•
Stopped: ./usrbin/chage -X 99999 sshd returned error code 1.
Removing user sshd...
dpkg: error processing package openssh-server (--configure):
subprocess install post-installation script returned error e
Setting up ssh-import-id
Processing triggers far systemd (229-4ubuntu21.21)
Processing triggers for ureadahead
Processing triggers for ufw
Errors were encountered while processing: openssh-server
E: Sub-processer /usr/bin/dpkg returned an error code (1)
我尝试了以下一些解决方案:
mount -o remount,rw /
=> 但没有运气- 我编辑了文件
/etc/pam.d/common-password
:
password [success=1 default=ignore] pam_unix.so obscure use_authtok try_first_pass sha512
但没有运气
- 我的
/etc/passwd
-rw-r--r-- 1 root root 2527
输出df /etc
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda4 131793388 39254516 86848820 32% /
请帮忙!
答案1
检查/etc/ssh
目录是否已创建。如果没有,请使用以下命令创建该目录sudo mkdir /etc/ssh
创建后,执行以下操作:
sudo apt-get purge openssh-server openssh-client sudo apt-get install openssh-server openssh-client