Ask Your Question
0

Use ssh without password for specific user on OpenStack instance

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

Jencek gravatar image

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

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
0

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

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

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

cheers, hauke

edit flag offensive delete link more
0

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

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

Hi,

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.

Regards

edit flag offensive delete link more

Comments

Sorry, for the previous wrong answer

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

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

Seen: 682 times

Last updated: Jan 13 '16