Skip to main content

Connecting to remote server via SSH issue

Comments

6 comments

  • GOT
    SSH keys are installed per user, so just because you installed a key for root that key does not apply to user xyz. You would need to add the same key to /home/xyz/.ssh/authorized_keys as well to use the same key for this other user.
    0
  • bloatedstoat
    Is the user in the wheel group?
    0
  • OnlySachin7
    Yes. I have added xyz user in wheel group as well as created new ssh key for that xyz user and added that on remote server but still it's showing me Permission denied (publickey,gssapi-keyex,gssapi-with-mic). error... However, if I do ssh from xyz user like: ssh root@remoteserver then it works but not like: ssh remoteserver -=-=-=-=- [xyz@authserver .ssh]$ssh root@remoteserver Enter passphrase for key '/home/xyz/.ssh/id_rsa': Last login: Mon Jun 3 11:14:47 2019 from x.x.x.x root@remoeserver [/tmp]# -=-=-=-=- Also, one thing, I want when I do SSH from xyz user to remoteserver then remoteserver should show xyz user not root... like... -=-=-=-=- [xyz@server .ssh]$ssh root@remoteserver Enter passphrase for key '/home/xyz/.ssh/id_rsa': Last login: Mon Jun 3 11:14:47 2019 from x.x.x.x xyz@remoeserver [/tmp]#whoami xyz xyz@remoeserver [/tmp]# -=-=-=-=- and whatever I will fire commands through xyz user on remoteserver then history should save on Auth server under xyz user bash history...
    0
  • cPanelMichael
    Hello @OnlySachin7, Can you verify if the AllowUsers directive is enabled in /etc/ssh/sshd_config on the remote server you are connecting to via SSH? Thank you.
    0
  • OnlySachin7
    Hello @OnlySachin7, Can you verify if the AllowUsers directive is enabled in /etc/ssh/sshd_config on the remote server you are connecting to via SSH? Thank you.

    Thanks for the reply Michael. Yes. I have tried that as well but not working. Actually when I am doing ssh to remote server from 'xyz' user like ssh remote then it shows error on remote server in secure logs as invalid xyz user.
    0
  • cPanelMichael
    Yes. I have tried that as well but not working.

    Hello @OnlySachin7, Can you confirm the step-by-step instructions for the specific change you made related to the AllowUsers directive? Thank you.
    0

Please sign in to leave a comment.