0

I have the following scenario regarding serverspec run:

I login to VM using user certificate and then do a sudo su -. Now as a root, I switch to dummy user which requires no password.

Then using the dummy user I initialize serverspec using /opt/chefdk/embedded/bin/serverspec-init and configure it for a sample test in the same VM.

Now when I try this using the dummy /opt/chefdk/embedded/bin/rspec spec/X.X.X.X/sample_spec.rb

It keeps on asking for user password which is just a certificate.

I want to avoid this and want the serverspec to make the spec run without password prompt.

I am not able to figure it out. Kindly help.

Thanks!

KronnorK
  • 539
  • 5
  • 17

1 Answers1

1

You can just set up password on 'dummy' account, and test it then.

Another option would be by adding 'dummy' user to sudoers file and allowing him to run passwordless sudo for specific commands - they should match the commands defined in the *_spec.rb files, which is more safe, but will require more typing ;)

Here is is the answer how to set up passwordless sudo for given user: https://serverfault.com/questions/160581/how-to-setup-passwordless-sudo-on-linux

Community
  • 1
  • 1
KaszpiR
  • 71
  • 1
  • 4
  • This helps too... Now the thing that i did was to create a common user which can access remote servers without passwords but a public key which I specifically mentioned in the spec helper file.. and it worked.. Thanks! – KronnorK Sep 10 '15 at 03:22