Tighten access rights even further

This commit is contained in:
fleaz 2025-06-01 00:07:15 +02:00
parent ae7b485bbf
commit 68bbd5fa0e
Signed by: fleaz
GPG key ID: 935474624265FE8F

3
ktx
View file

@ -7,7 +7,8 @@ _create_file_and_switch() {
NAMESPACE=${2}
FILENAME="$HOME/.kube/ktx/${CONTEXT}_${NAMESPACE}.conf"
KUBECONFIG= kubectl config view --minify --flatten --context ${CONTEXT} > ${FILENAME}
chmod o-rwx ${FILENAME}
# Only the user is allowed to read and write
chmod u=rw,go-rwx ${FILENAME}
export KUBECONFIG=${FILENAME}
kubectl config set-context --current --namespace=${NAMESPACE}
ln -sf ${FILENAME} ${CUR_FILE}