search for: use_id_fil

Displaying 2 results from an estimated 2 matches for "use_id_fil".

Did you mean: use_id_file
2016 May 30
1
[Bug 2575] New: ssh-copy-id fails when it can not find any key file in ~/.ssh
...DEFAULT_PUB_ID_FILE="$HOME/$(cd "$HOME" ; ls -t .ssh/id*.pub 2>/dev/null | grep -v -- '-cert.pub$' | head -n 1)" It sets + DEFAULT_PUB_ID_FILE=/root/ which passes the condition + '[' -r /root/ ']' and the execution gets into the function use_id_file() unnoticed and fails to open file /usr/bin/ssh-copy-id: line 87: /root/.pub: No such file or directory' Checking also if the file is regular file should solve the issue. Failing earlier is probably not a good idea, because we can still use ssh-agent keys (remains working). diff --g...
2012 Nov 07
1
ssh-copy-id usability improvement
...73f01fec64617c Author: Amir Yalon <git at please.nospammail.net> Date: Wed Nov 7 12:44:40 2012 +0200 Enable suffix other than .pub in argument to -i diff --git a/ssh-copy-id b/ssh-copy-id index 8cdad28..efa0d29 100755 --- a/ssh-copy-id +++ b/ssh-copy-id @@ -23,10 +23,10 @@ usage () { use_id_file() { local L_ID_FILE=$1 - if expr "$L_ID_FILE" : ".*\.pub$" >/dev/null ; then - PUB_ID_FILE="$L_ID_FILE" - else + if [ -f "$L_ID_FILE.pub" ]; then PUB_ID_FILE="$L_ID_FILE.pub" + else + PUB_ID_FILE="$L_ID_FILE" fi...