mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 15:54:22 +02:00
ssh-copy-id: add -x option (for debugging)
This option causes the ssh-copy-id to run with set -x SSH-Copy-ID-Upstream: a0ee367ea8c0a29c8b4515245e408d2d349e7844
This commit is contained in:
parent
b4a1efdcb8
commit
cf84498f67
@ -66,10 +66,11 @@ SSH="ssh -a -x"
|
|||||||
umask 0177
|
umask 0177
|
||||||
|
|
||||||
usage () {
|
usage () {
|
||||||
printf 'Usage: %s [-h|-?|-f|-n|-s] [-i [identity_file]] [-p port] [-F alternative ssh_config file] [[-o <ssh -o options>] ...] [user@]hostname\n' "$0" >&2
|
printf 'Usage: %s [-h|-?|-f|-n|-s|-x] [-i [identity_file]] [-p port] [-F alternative ssh_config file] [[-o <ssh -o options>] ...] [user@]hostname\n' "$0" >&2
|
||||||
printf '\t-f: force mode -- copy keys without trying to check if they are already installed\n' >&2
|
printf '\t-f: force mode -- copy keys without trying to check if they are already installed\n' >&2
|
||||||
printf '\t-n: dry run -- no keys are actually copied\n' >&2
|
printf '\t-n: dry run -- no keys are actually copied\n' >&2
|
||||||
printf '\t-s: use sftp -- use sftp instead of executing remote-commands. Can be useful if the remote only allows sftp\n' >&2
|
printf '\t-s: use sftp -- use sftp instead of executing remote-commands. Can be useful if the remote only allows sftp\n' >&2
|
||||||
|
printf '\t-x: debug -- enables -x in this shell, for debugging\n' >&2
|
||||||
printf '\t-h|-?: print this help\n' >&2
|
printf '\t-h|-?: print this help\n' >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
@ -112,7 +113,7 @@ if [ -n "$SSH_AUTH_SOCK" ] && ssh-add -L >/dev/null 2>&1 ; then
|
|||||||
GET_ID="ssh-add -L"
|
GET_ID="ssh-add -L"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while getopts "i:o:p:F:fnsh?" OPT
|
while getopts "i:o:p:F:fnsxh?" OPT
|
||||||
do
|
do
|
||||||
case "$OPT" in
|
case "$OPT" in
|
||||||
i)
|
i)
|
||||||
@ -135,6 +136,9 @@ do
|
|||||||
s)
|
s)
|
||||||
SFTP=sftp
|
SFTP=sftp
|
||||||
;;
|
;;
|
||||||
|
x)
|
||||||
|
set -x
|
||||||
|
;;
|
||||||
h|\?)
|
h|\?)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
|
@ -32,6 +32,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
.Op Fl f
|
.Op Fl f
|
||||||
.Op Fl n
|
.Op Fl n
|
||||||
.Op Fl s
|
.Op Fl s
|
||||||
|
.Op Fl x
|
||||||
.Op Fl i Op Ar identity_file
|
.Op Fl i Op Ar identity_file
|
||||||
.Op Fl p Ar port
|
.Op Fl p Ar port
|
||||||
.Op Fl o Ar ssh_option
|
.Op Fl o Ar ssh_option
|
||||||
@ -91,6 +92,11 @@ With this option the user's
|
|||||||
.Pa ~/.ssh/authorized_keys
|
.Pa ~/.ssh/authorized_keys
|
||||||
file will be downloaded, modified locally and uploaded with sftp.
|
file will be downloaded, modified locally and uploaded with sftp.
|
||||||
This option is useful if the server has restrictions on commands which can be used on the remote side.
|
This option is useful if the server has restrictions on commands which can be used on the remote side.
|
||||||
|
.It Fl x
|
||||||
|
This option is for debugging the
|
||||||
|
.Nm
|
||||||
|
script itself.
|
||||||
|
It sets the shell's -x flag, so that you can see the commands being run.
|
||||||
.It Fl h , Fl ?
|
.It Fl h , Fl ?
|
||||||
Print Usage summary
|
Print Usage summary
|
||||||
.It Fl p Ar port , Fl o Ar ssh_option
|
.It Fl p Ar port , Fl o Ar ssh_option
|
||||||
|
Loading…
x
Reference in New Issue
Block a user