Is there a way in SCM CLI that password can be given from password file?
Accepted answer
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.
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.
Comments
1 vote