Spacecmd ~/.spacecmd/config Doesn't Prompt For Password When -u Is Used

(Doc ID 2304026.1)

Last updated on SEPTEMBER 18, 2017

Applies to:

Linux OS - Version Oracle Linux 6.0 with Unbreakable Enterprise Kernel [2.6.32] and later
Linux x86-64

Symptoms

When the config file is used for spacecmd and need to long in with a different user than in .config with "-u" via command line,
spacecmd no longer prompts for the "-u" users password. Spacecmd is attempting to use the password for the specified user and label from the config file.
Per the man pages "Command-line arguments always override options in the configuration files."
However it is not detecting that the user information being entered does not match the config file and then move on to prompting the user for the password.

NOTE: When putting the password with the -p flag it works. However, that leaves the password in the history of the user which is something that we would like to avoid.


1. spacewalk spacecmd .config file

$ cd ~/.spacecmd/

$ pwd
/path/to/.spacecmd

$ cat config
[spacecmd]

[yyyyy]
username=xxxx
password=xxxx123

2. Trying to login default so that it will login with user mentioned in .config file

$ spacecmd -s xxxx
Welcome to spacecmd, a command-line interface to Spacewalk.

Type: 'help' for a list of commands
  'help ' for command-specific help
  'quit' to quit

INFO: Spacewalk Username: xxxx <<<<<< Mentioned in .confi file
INFO: Connected to https://xxxx/rpc/api as xxxxx
spacecmd {SSM:0}> exit

3. Trying to login different than in the .config file eg: username = xxxxx

$ spacecmd -s xxxx-u xxxxx
Welcome to spacecmd, a command-line interface to Spacewalk.

Type: 'help' for a list of commands
  'help ' for command-specific help
  'quit' to quit

INFO: Spacewalk Username: xxxx
ERROR: Invalid credentials >>>>>>>>>>>>>>>>>>>> Getting error.



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms