You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you add a feature and configuration that would allow specifying the user name? That way with SSH_KEY and the proposed USER config, the tool will be able to specify the rest of this.
From this_user@localhost:
ssh -i ~/.ssh/id_rsa THAT_user@remotehost
The text was updated successfully, but these errors were encountered:
Below is the minimal solution to the above request. I added the USR variable and an echo of the actual command. Previously I was getting authentication errors because the user name was different.
This is the bottom of the common.sh file.
USR="hadoop@"
ssh_w() {
h=$(echo $1 | cut -d: -f1) # hostname
p=$(echo $1 | cut -d: -f2 -s) # port
shift
if test -z $p; then p=22; fi
echo ssh $_ssh_key -p $p $USR$h "$@"
ssh $_ssh_key -p $p $USR$h "$@"
}
scp_to_w() {
# do not use as first parameter dir/*, use this between quotes
# i.e "dir/*" (prevents shell expansion)
h=$(echo $1 | cut -d: -f1) # hostname
p=$(echo $1 | cut -d: -f2 -s) # port
shift
if test -z $p; then p=22; fi
echo scp $_ssh_key -p -r -P $p $1 $USR$h:$2
scp $_ssh_key -p -r -P $p $1 $USR$h:$2
}
scp_from_w() {
# do not use as first parameter dir/*, use this between quotes
# i.e "dir/*" (prevents shell expansion)
h=$(echo $1 | cut -d: -f1) # hostname
p=$(echo $1 | cut -d: -f2 -s) # port
shift
if test -z $p; then p=22; fi
echo scp $_ssh_key -p -r -P $p $USR$h:$1 $2
scp $_ssh_key -p -r -P $p $USR$h:$1 $2
}
Could you add a feature and configuration that would allow specifying the user name? That way with SSH_KEY and the proposed USER config, the tool will be able to specify the rest of this.
From this_user@localhost:
ssh -i ~/.ssh/id_rsa THAT_user@remotehost
The text was updated successfully, but these errors were encountered: