Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Use Stash CLI without visible password?

Config Manager
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 2, 2015

I'm using the "RUN CLI Actions in Stash" add-on, and would like to know if there is any way to issue a CLI command without specifying the password in plaintext.

I'm writing various scripts which will be stored centrally and don't want the password to be visible to all. I could make the password a script argument, or have it prompted for, but wondered if there is an alternative, perhaps using the SSH key.

2 answers

1 accepted

1 vote
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 2, 2015

When using the CLI directly from a command line, you can:

  1. Hide the password in stash.sh so that it is not needed in any script 
  2. Use OS environment variable(s). 

When running from Run CLI Actions, the options are limited currently. You would need to hard code the password on the hook definition and therefore it would not be needed in a reference script. We are looking at some other options like SCLI-51. Suggest you document any additional requirements by there are in a new issue.

Config Manager
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2015

I've gone for a variant of option 2. The script looks for a particular environment variable for the password and if not set, prompts for it. Thanks!

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 2, 2015

Hello John,

Thank you for your question.

Please, refer to How to Setup SSH for Auto Login without a Password for further information.

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events