|
Lines 291-302
case "$REMOTE_VERSION" in
Link Here
|
| 291 |
fi |
291 |
fi |
| 292 |
;; |
292 |
;; |
| 293 |
*) |
293 |
*) |
| 294 |
# Assuming that the remote host treats ~/.ssh/authorized_keys as one might expect |
294 |
# Discovers remote host authorized_keys location via `sshd -T` |
|
|
295 |
# default value is: authorizedkeysfile .ssh/authorized_keys .ssh/authorized_keys2 |
| 295 |
populate_new_ids 0 |
296 |
populate_new_ids 0 |
| 296 |
# in ssh below - to defend against quirky remote shells: use 'exec sh -c' to get POSIX; |
297 |
# in ssh below - to defend against quirky remote shells: use 'exec sh -c' to get POSIX; |
| 297 |
# 'cd' to be at $HOME; add a newline if it's missing; and all on one line, because tcsh. |
298 |
# 'cd' to be at $HOME; add a newline if it's missing; and all on one line, because tcsh. |
| 298 |
[ "$DRY_RUN" ] || printf '%s\n' "$NEW_IDS" | \ |
299 |
[ "$DRY_RUN" ] || printf '%s\n' "$NEW_IDS" | \ |
| 299 |
ssh "$@" "exec sh -c 'cd ; umask 077 ; mkdir -p .ssh && { [ -z "'`tail -1c .ssh/authorized_keys 2>/dev/null`'" ] || echo >> .ssh/authorized_keys ; } && cat >> .ssh/authorized_keys || exit 1 ; if type restorecon >/dev/null 2>&1 ; then restorecon -F .ssh .ssh/authorized_keys ; fi'" \ |
300 |
ssh "$@" "exec sh -c 'cd ; umask 077 ; authorized_keys=\$( sshd -T 2> /dev/null | grep authorizedkeysfile | cut -d\" \" -f2 | sed -e \"s#%h#\$HOME#g; s#%u#\$USER#g; s#%%#%#g\" ) ; authorized_keys=\${authorized_keys:=.ssh/authorized_keys} ; dotssh=\$( dirname \$authorized_keys ) ; mkdir -p \$dotssh && { [ -z "'`tail -1c \$authorized_keys 2>/dev/null`'" ] || echo >> \$authorized_keys ; } && cat >> \$authorized_keys || exit 1 ; if type restorecon >/dev/null 2>&1 ; then restorecon -F \$dotssh \$authorized_keys ; fi'" \ |
| 300 |
|| exit 1 |
301 |
|| exit 1 |
| 301 |
ADDED=$(printf '%s\n' "$NEW_IDS" | wc -l) |
302 |
ADDED=$(printf '%s\n' "$NEW_IDS" | wc -l) |
| 302 |
;; |
303 |
;; |
| 303 |
- |
|
|