Password for installing models?

Hi all,

I am trying to install and use kim-api-v.1.9.3, following information
on https://openkim.org/kim-api/.
In 'Installing KIM Models' it says you should do

$ kim-api-v1-collections-management install system --sudo Three_Body_Stillinger_Weber_Si__MO_405512056662_003

but this requires Password. (Prompt like "Enter Password : " appears.)
How can I get the password?

Thanks in advance,
Yoshi

Hi Yoshi,

When you use the "--sudo" option the utility will do something like

   sudo make install

So the password that is being requested is the one that would be necessary to execute the above "sudo" command. This is typically the password for the user account that is executing the command.

If you happen to be do this all on a virtual machine, and in particular using vagrant, then you would typically be logged in as user-name "vagrant" which, by default will have a password of "vagrant".

Cheers,

Ryan

Hi Ryan,

thanks for the response, but I naturally tried the user password already.
What is being requested seems to be different from that for executing sudo.

I am having trouble with the prompt
Enter Password :
and when it requests the sudo password, it asks like
[sudo] password for umeno:

From second try the latter prompt does not appear because the sudo password
is already fed.

I have tried

my user account password
root password
blank
'vagrant' (just in case, knowing I am not working on a virtual machine)

all in vain.

Is there any other thing that I should try?
Is there any way to add models/tests manually?

Best,
Yoshi

Hi Yoshi,

Sorry it is not working. The "Enter Password" prompt is coming from the kim-api-v1-collections-managment utility, which uses what you enter to do various "sudo xxxx" commands. So, it should be the user account password that is needed... What does the utility say after you enter a password?

Anyway,...

You can always install your models to the "User Collection", which should not need any passwords. Just use this command instead of the original:

$ kim-api-v1-collections-management install user Three_Body_Stillinger_Weber_Si__MO_405512056662_003

Ryan

Hi Ryan,

thanks for your kind support.

Sorry it is not working. The "Enter Password" prompt is coming from the
kim-api-v1-collections-managment utility, which uses what you enter to do
various "sudo xxxx" commands. So, it should be the user account password that
is needed... What does the utility say after you enter a password?

When I do

  $ kim-api-v1-collections-management install system --sudo Three_Body_Stillinger_Weber_Si__MO_405512056662_003

I get

  Enter Password :

I type my user account password, then I get

  [sudo] password for umeno:

then the following message appears.

  Bad password.

  Aborting!

I found that getting around this problem is possible simply
by doing 'install system' as root, but I'd feel more comfortable
with doing it by sudo.

You can always install your models to the "User Collection", which should not
need any passwords. Just use this command instead of the original:

$ kim-api-v1-collections-management install user
Three_Body_Stillinger_Weber_Si__MO_405512056662_003

Thanks for the tip! If I cannot solve the above problem
I'll live with this, but I just think the way in the quick guide
in https://openkim.org/kim-api/ should work..

Best,
Yoshi

When I do

$ kim-api-v1-collections-management install system --sudo Three_Body_Stillinger_Weber_Si__MO_405512056662_003

I get

Enter Password :

I type my user account password, then I get

[sudo] password for umeno:

then the following message appears.

Bad password.

Aborting!

Hi Yoshi, thanks this is helpful.

The utility uses the "-k" and "-S" command line options to sudo. It looks like maybe your version of sudo does not support these?

Here:
https://github.com/openkim/kim-api/blob/093102fcbe337a0b18d207a919657417cc362a52/src/utils/collections-management.sh#L672

get_password () {
   printf "Enter Password : "
   stty -echo
   trap 'stty echo' EXIT
   read PASSWORD
   stty echo
   trap - EXIT
   printf "\n"
   if ! (printf -- "${PASSWORD}\n" | \
           sudo -k -S printf "" > /dev/null 2>&1); then
     printf "Bad password.\n"
     return 1
   fi
}

you can see the code for how the utility is trying to execute the sudo command at the point that you are having trouble.

I am happy to continue to work with you to figure this out. If this is a problem that other users would run into, I would like to find a fix that we can include in the utility...

Cheers,

Ryan

Hi Ryan,

The utility uses the "-k" and "-S" command line options to sudo. It looks like
maybe your version of sudo does not support these?

Uh, you are right! On my system, strangely, sudo I was executing is just a wrapper
to the actual sudo, so 'sudo -k -S' does not work properly (the wrapper cannot
handle the options).

I am on CentOS6.9 and the wrapper came with devtoolset-1.1-runtime-1-13.el6.noarch
which was needed to upgrade gfortran by devtoolset-1.1-gcc-gfortran-4.7.2-5.el6.x86_64
(to let it coexist with its older version).

I am happy to continue to work with you to figure this out. If this is a
problem that other users would run into, I would like to find a fix that we can
include in the utility...

I don't know whether this is a possible pitfall some people may fall in,
or it's just that my system is a freak.
Anyway, thanks for your kind support to help me out!

Best,
Yoshi

Ah, interesting...

This seems to be a known issue:

https://bugzilla.redhat.com/show_bug.cgi?id=1319936

Cheers,

Ryan