aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2026-09-10 09:06:35 +0200
committerNicholas Rodrigues Lordello <[email protected]>2026-09-10 09:06:35 +0200
commit1c46b80e3a4c2064d1ce8b818463ae7daf08183f (patch)
treeaaae428c4f9be0abd5c86e7c6ea013ec20aee565
parentfedf21ce50057d20e431475447fc9e510f32b8ba (diff)
Fix SSH User Configuration
While `User=%u` does work in practice, it has some negative side effects. In paricular, `Match` configurations in the user-supplied `.config/dbx/$NAME.ssh_config` use the literal %u instead of the expanded value. Get the user name manually with `id -un` and use that instead of relying on %u expansion.
-rwxr-xr-xdbx2
1 files changed, 1 insertions, 1 deletions
diff --git a/dbx b/dbx
index ae38e35..6998234 100755
--- a/dbx
+++ b/dbx
@@ -269,7 +269,7 @@ ssh_user() {
if [ -n "$asroot" ]; then
user="root"
else
- user="%u"
+ user="$(id -un)"
fi
printf "User=%s\n" "$user"
}