跳到主要内容

Debugging "deskpro_admin@localhost; Permission denied" errors

在 General Issues 中
作者列表
已发布: 2022年6月29日|最后更新: 2022年6月29日

If you are experiencing a permissions error when performing certain actions the OPC, such as the following:

image.png

This issue often appears if there has been a change to the SSH configuration on the host server. As the OPC container uses SSH to connect to the host server to perform actions, a change to the SSH configuration to limit how or who can connect to the host server can block the OPC from working.

The OPC connects to the host server using the deskpro_admin user, and an RSA key generated on installation. Some typical issues and fixes are as follows:

The permissions / ownership of the /home/deskpro_admin/.ssh/authorized_keys file are incorrect Copy link to The permissions / ownership of the /home/deskpro_admin/.ssh/authorized_keys file are incorrect to clipboard

This can be resolved with the following command:

chown -R deskpro_admin: /home/deskpro_admin/.ssh && chmod -R 500 /home/deskpro_admin/.ssh
copy

The public key does not exist in /home/deskpro_admin/.ssh/authorized_keys Copy link to The public key does not exist in /home/deskpro_admin/.ssh/authorized_keys to clipboard

There is a copy of the original public key file in /opt/deskpro/data/opc/provisioner_ssh_key.pub, which will need to be re-added to the authorized keys list with the following command:

cat /opt/deskpro/data/opc/provisioner_ssh_key.pub >> /home/deskpro_admin/.ssh/authorized_keys
copy

The private key is lost or no longer valid Copy link to The private key is lost or no longer valid to clipboard

A new private key will need to be regenerated in /opt/deskpro/data/opc with the following command:

ssh-keygen -P "" -b 4096 -f /opt/deskpro/data/opc/provisioner_ssh_key
copy

Set the correct permissions to the file:

chown root:deskpro_admin /opt/deskpro/data/opc/provisioner_ssh_key && chmod 500 /opt/deskpro/data/opc/provisioner_ssh_key
copy

Then, the new public key will need to be authorized:

cat /opt/deskpro/data/opc/provisioner_ssh_key.pub >> /home/deskpro_admin/.ssh/authorized_keys
copy

Finally, the OPC service will need to be restarted to load the new SSH key:

systemctl restart opc_webgui
copy

SSHD configuration is blocking access Copy link to SSHD configuration is blocking access to clipboard

If you have set a custom configuration in /etc/ssh/sshd_config, you will need to ensure that the deskpro_admin user has the ability to login via public key.

有帮助没有帮助

1 人中 0 人认为这个页面有帮助

下一个页面How can an agent access an instance they are locked out of?

请登录或注册以提交评论。