Skip to content

Commit

Permalink
fix: silence various parts of the output for privacy
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Dec 9, 2023
1 parent 69383f6 commit bd7c0df
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ssh-remote-action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ fi
SSH_PORT=${SSH_PORT:-22}

# Define the default SSH arguments that apply for both key and password flows
SSH_ARGS="-o StrictHostKeyChecking=no -p ${SSH_PORT} ${SSH_USERNAME}@${SSH_HOST}"
SSH_ARGS="-o StrictHostKeyChecking=no -o LogLevel=ERROR -p ${SSH_PORT} ${SSH_USERNAME}@${SSH_HOST}"

eval "$(ssh-agent -s)"
eval "$(ssh-agent -s)" &>/dev/null
echo "SSH Agent started"

if [ -n "${SSH_KEY}" ]; then
echo "Using SSH key..."
Expand All @@ -39,7 +40,7 @@ if [ -n "${SSH_KEY}" ]; then
if [ -z "${SSH_KEY_PASSPHRASE}" ]; then
echo "SSH Key Passphrase is empty, just adding the key to the SSH agent..."
# Add the private key to the SSH agent
ssh-add ./private.key > /dev/null
ssh-add -q ./private.key &>/dev/null
echo "SSH Identity Added"
else
echo "SSH Key Passphrase is set, creating a script to echo the passphrase and adding the key to the SSH agent..."
Expand All @@ -48,7 +49,7 @@ if [ -n "${SSH_KEY}" ]; then
chmod +x ./ssh-passphrase

# Set the permissions
DISPLAY=1 SSH_ASKPASS="./ssh-passphrase" ssh-add ./private.key > /dev/null
DISPLAY=1 SSH_ASKPASS="./ssh-passphrase" ssh-add -q ./private.key &>/dev/null
echo "SSH Identity Added"
fi

Expand Down

0 comments on commit bd7c0df

Please sign in to comment.