Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is there a way in SCM CLI that password can be given from password file?

Hi,
For using SCM CLI, can we give password (for logging in to repository) from a password file instead of typing it using -P option?

RTC v6.0.1

0 votes


Accepted answer

Permanent link
The following works on Windows (a similar technique can probably be used in UNIX/Linux with "cat"):

C:\Temp>type pw.txt | lscm login -r https://jazz.somedomain.com:9443/ccm/ -n jazz -u someuser -c
Password (someuser @ https://jazz.somedomain.com:9443/ccm/):
Logged in to https://jazz.somedomain.com:9443/ccm/

C:\Temp>lscm logout -r jazz
Successfully logged out of https://jazz.somedomain.com:9443/ccm/

Note: the password prompt still appears at the terminal but nothing need be typed; it takes the password piped to it from standard in.

In this example pw.txt contains the password in plain text but it wouldn't be much of a stretch to have the password stored using some sort of encryption and instead of "type" (or "cat" on UNIX/Linux) use a program that will decrypt it to standard out so it can be piped to the lscm command.
Shuchita Tripathi selected this answer as the correct answer

0 votes

Comments

Hi Alan,

Thank you for your response. Somehow using 'type' and pipe i wasnt able to provide it as input to my command.
However your answer gave me an idea on the direction to go for.

Here is what I did.

set /p pwd=<pw.txt
cd <path>\jazz\scmtools\eclipse
call lscm login -r https://<server>/ccm -n jazz -u usrname -P %pwd%

That's because the -P / --password switch is not interactive so doesn't prompt.  Using -c / --cache switch prompts for  a password which it will take from the pipe.
Caching the password has other benefits too such as storing the password in an obfuscated form to make it more difficult to read and saving the password over a login session so you don't need to provide a password with each new command.

1 vote


One other answer

Permanent link
Hi Shuchita,

Please find the below link for similar posting.

https://jazz.net/forum/questions/115922/rtc-command-line-interface-password-encryption.

RFE: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=295660%C2%A0

Regards,
Arun.


1 vote

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,029
× 1,204
× 158
× 113

Question asked: Jul 08 '16, 6:45 a.m.

Question was seen: 4,349 times

Last updated: Jul 11 '16, 11:50 a.m.

Confirmation Cancel Confirm