cockpit账号登不上去怎么办

按照攻略安装和配置
adduser添加了一个新账号
passwd设置了一个密码
usermod -aG sudo username给了个高权限

登录的时候一直Wrong user name or password

https://zhile.io/2023/12/30/cockpit-configuration.html

ssh能不能登录?

不能的

Warning: Permanently added 'xxx' (ECDSA) to the list of known hosts.
xxx: Permission denied (publickey).

那自然也不能在cockpit登录。看起来是服务器禁止了密码方式登录1

一阵见血
注释掉PasswordAuthentication no就可以了,

神奇的来了
现在我可以用密码远程ssh登录了
cockpit还是说我密码错误=、=

无法登录的问题解决了

使用tail -f /var/log/auth.log捕捉到的错误是
Mar 10 14:32:11 ocp-jp1 cockpit-session: pam_listfile(cockpit:auth): /etc/cockpit/disallowed-users is either world writable or not a normal file

不记得我是不是我设置过umask,还是root账号安装的关系,反正意思就是这个文件不应该有写入权限。解决方法是

sudo chmod 640 /etc/cockpit/disallowed-users

现在可以登录进去了,又遇到新的问题

image

这里面也没看到什么有用的日志

Mar 10 14:31:54 ocp-jp1 systemd[1]: Starting Cockpit Web Service...
Mar 10 14:31:54 ocp-jp1 systemd[1]: Started Cockpit Web Service.
Mar 10 14:33:43 ocp-jp1 systemd[1]: cockpit.service: Deactivated successfully.
Mar 10 14:34:33 ocp-jp1 systemd[1]: Starting Cockpit Web Service...
Mar 10 14:34:33 ocp-jp1 systemd[1]: Started Cockpit Web Service.
Mar 10 14:36:06 ocp-jp1 systemd[1]: cockpit.service: Deactivated successfully.
Mar 10 14:39:24 ocp-jp1 systemd[1]: Starting Cockpit Web Service...
Mar 10 14:39:24 ocp-jp1 systemd[1]: Started Cockpit Web Service.
Mar 10 14:41:09 ocp-jp1 systemd[1]: cockpit.service: Deactivated successfully.
Mar 10 14:41:30 ocp-jp1 systemd[1]: Starting Cockpit Web Service...
Mar 10 14:41:30 ocp-jp1 systemd[1]: Started Cockpit Web Service.
Mar 10 14:45:26 ocp-jp1 systemd[1]: cockpit.service: Deactivated successfully.

似乎一直在自动重启,我没有执行重启服务的命令

看cockpit的日志呢

有没有遇到:Cannot refresh cache whilst offline

我是拿密钥登录的,岂不是用不了?倒霉

多网管理器问题, 禁用掉后解决

我是新建了个账号