[SOLVED] Not able to establish SSH connection to linux remote machine

  • Hi,

    I have two accounts on a remote linux machine:


    Account "soropro":


    Account "soropro":


    From the local machine can connect to the "solqpro" account (ssh_solqpro.txt), but not to then "soropro" account (ssh_soropro.txt), although I use the same public key:


    Any help will be appreciated.


    Thanks and regards,

    Jose Luis.

  • Did you check for lone endings, should be LF (linux)


    Add more vs ti

    ssh -vvv soropro@sfefac172

    or check the servers auth.log

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Hi,


    Attached is the "vvv" trace file.


    The remote SO is Red Hat Linux. This is the "secure" log file trace:

    Code
    Apr 22 10:53:43 sfefac172 sshd[15112]: reprocess config line 45: Deprecated option RSAAuthentication
    Apr 22 10:53:49 sfefac172 sshd[15112]: Accepted password for soropro from 10.91.17.24 port 62070 ssh2
    Apr 22 10:53:49 sfefac172 sshd[15112]: pam_unix(sshd:session): session opened for user soropro by (uid=0)
    Apr 22 10:54:07 sfefac172 sshd[15157]: Received disconnect from 10.91.17.24 port 62070:11: disconnected by user
    Apr 22 10:54:07 sfefac172 sshd[15157]: Disconnected from 10.91.17.24 port 62070
    Apr 22 10:54:07 sfefac172 sshd[15112]: pam_unix(sshd:session): session closed for user soropro>


    Regards,

    Jose Luis

  • Your server does not accept this key:


    Code
    debug1: Offering public key: /home/jlfdiaz/.ssh/id_rsa RSA SHA256:yiq3918jgRSLFBzz6phLLL7txn6JUh0+4/U/ePcahgY

    May this be related to this:


    Code
    Apr 22 10:53:43 sfefac172 sshd[15112]: reprocess config line 45: Deprecated option RSAAuthentication

    Try to fix the sshd config of the RHEL server.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Hi,


    Attached is the sshd log with "LogLevel DEBUG3"


    I don't understand why it can't open the authorized_keys file with "temporarily_use_uid: 1009/1009":



    Code
    Apr 25 18:25:11 sfefac172 sshd[19652]: debug1: temporarily_use_uid: 1009/1009 (e=0/0)
    Apr 25 18:25:11 sfefac172 sshd[19652]: debug1: trying public key file /fac/desa/soropro/.ssh/authorized_keys
    Apr 25 18:25:11 sfefac172 sshd[19652]: debug1: Could not open authorized keys '/fac/desa/soropro/.ssh/authorized_keys': Permission denied



    Code
    soropro@sfefac172 ~]$ echo $USER
    soropro
    [soropro@sfefac172 ~]$ id
    uid=1009(soropro) gid=1009(soropro) groups=1009(soropro) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023


    Regards,

    Jose Luis

  • what is the output of

    stat /fac/desa/soropro/.ssh/authorized_keys

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Hi,


    This is the output:


    Code
    [solqpro@sfefac172 ~]$ stat /fac/desa/solqpro/.ssh/authorized_keys
    File: ‘/fac/desa/solqpro/.ssh/authorized_keys’
    Size: 973             Blocks: 8          IO Block: 4096   regular file
    Device: fd02h/64770d    Inode: 79707082    Links: 1
    Access: (0600/-rw-------)  Uid: ( 1006/ solqpro)   Gid: ( 1006/ solqpro)
    Context: unconfined_u:object_r:ssh_home_t:s0
    Access: 2022-04-25 10:36:54.489806266 +0200
    Modify: 2022-04-25 10:36:52.734809582 +0200
    Change: 2022-04-25 10:36:52.734809582 +0200
    Birth: -



  • Check file permissions of the directories /fac/desa/solqpro/.ssh/ and above.


    Code
    stat /fac/desa/solqpro/.ssh
    stat /fac/desa/solqpro

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.


  • You have SELinux enabled on RHEL and the settings for soropro do not match.

    For SELinux read: https://access.redhat.com/docu…tors_guide/part_i-selinux


    try to fix:


    Code
    sudo chcon -R unconfined_u:object_r:ssh_home_t:s0 /fac/desa/soropro/.ssh
    sudo chcon unconfined_u:object_r:user_home_t:s0 /fac/desa/soropro

    Check paths and spelling in the command and next time ask your sysadmin for help with SELinux.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • jlfdiaz

    Hat das Label gelöst hinzugefügt.
  • jlfdiaz

    Hat den Titel des Themas von „Not able to establish SSH connection to linux remote machine“ zu „[SOLVED] Not able to establish SSH connection to linux remote machine“ geändert.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!