Skip to content

Commit 29cf64a

Browse files
author
olevole
committed
do not manage ~cbsd/.ssh/authorized_keys due to security reason
historically, cbsd user was only used for remote commands after "cbsd node mode=add" operations. At the moment there are several frontend systems for CBSD that require adding an unprivileged user to the cbsd group. This can lead to leakage of the private/public key through the frontend and access to the server if the server administrator has not closed the SSH and does not block the "cbsd" user of the through SSH. Accordingly, if administrator want "cbsd node mode=add", he must copy the public key into ~cbsd/.ssh/authorized_keys.
1 parent 0cf05f3 commit 29cf64a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

etc/defaults/qlogin.conf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ if [ -d ${jailsysdir}/${jname}/cloud-init ]; then
4040
# try lookup for global
4141
eval _pubkey="\$ci_user_pubkey"
4242
fi
43-
if [ "${_pubkey}" = ".ssh/authorized_keys" ]; then
43+
if [ "${_pubkey}" = ".ssh/id_rsa.pub" ]; then
44+
echo "qlogin.conf: ${SSH_CMD} -oStrictHostKeyChecking=no -oConnectTimeout=15 -oServerAliveInterval=10 -i ${workdir}/.ssh/id_rsa ${ci_user_add}@${first_ip4_addr}" 1>&2
45+
login_cmd="${SSH_CMD} -oStrictHostKeyChecking=no -oConnectTimeout=15 -oServerAliveInterval=10 -i ${workdir}/.ssh/id_rsa ${ci_user_add}@${first_ip4_addr}"
46+
elif [ "${_pubkey}" = ".ssh/authorized_keys" ]; then
47+
# back compat for CBSD < 14.1.3
4448
echo "qlogin.conf: ${SSH_CMD} -oStrictHostKeyChecking=no -oConnectTimeout=15 -oServerAliveInterval=10 -i ${workdir}/.ssh/id_rsa ${ci_user_add}@${first_ip4_addr}" 1>&2
4549
login_cmd="${SSH_CMD} -oStrictHostKeyChecking=no -oConnectTimeout=15 -oServerAliveInterval=10 -i ${workdir}/.ssh/id_rsa ${ci_user_add}@${first_ip4_addr}"
4650
else

0 commit comments

Comments
 (0)