It's all about the answers!

Ask a question

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


Shuchita Tripathi (31436395) | asked Jul 08 '16, 6:45 a.m.
edited Jul 11 '16, 11:01 a.m. by David Lafreniere (4.8k7)
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

Accepted answer


permanent link
Alan Sampson (93749) | answered Jul 08 '16, 7:15 p.m.
JAZZ DEVELOPER
edited Jul 08 '16, 7:24 p.m.
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

Comments
Shuchita Tripathi commented Jul 11 '16, 3:49 a.m.

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%


1
Alan Sampson commented Jul 11 '16, 11:50 a.m.
JAZZ DEVELOPER

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.

One other answer



permanent link
Arun K Sriramaiah (3.2k13177) | answered Jul 08 '16, 10:38 a.m.
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.


Your answer


Register or 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.