Use ssh without password for specific user on OpenStack instance

asked 2016-01-12 13:58:05 -0600

Jencek gravatar image

updated 2016-01-13 09:27:54 -0600

rbowen gravatar image

Hello community,

I am trying to solve problem with ssh command on Centos 6.6. I have OpenStack instance with generated keypair. So when I am accessing the instance I have to set command like "ssh -i nameOfKey.key centos@hostname". Problem occurring when I need to install on Linux some IBM software and it is calling command like "ssh smadmin@localhost". I want set in /etc/ssh/sshd_config that some user/group can use ssh command without -i parameter and key. Is it possible? I have written next 4 lines into sshd_config.

Match user jp
    PasswordAuthentication no
    GSSAPIAuthentication no
    PubkeyAuthentication no

But if I try to ssh user jp(ssh jp@localhost). I got "Permission denied, please try again". Thanks for any advice Jan.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2016-01-13 09:32:47 -0600

updated 2016-01-13 09:45:38 -0600


For my point of view, a better solution would be use known hosts

  1. Create a ssh key for the user: ssh-keygen
  2. Change the value to PasswordAuthentication yes
  3. Restart ssh service.
  4. Copy the key to the host: ssh-copy-id hostIP
  5. Try login again without password.


edit flag offensive delete link more


Sorry, for the previous wrong answer

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2016-01-13 09:44:57 -0600 )edit

answered 2016-02-28 06:13:58 -0600

At least you'll need the IdentityFile directive in your SSH config file.

Personally I solve issue like that while matching against the host(name), like

  HostName #IP-Address will also do
  User jp
  IdentityFile ~/.ssh/my_privat_key

cheers, hauke

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2016-01-12 13:58:05 -0600

Seen: 936 times

Last updated: Jan 13 '16