Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Updated OpenSSH Incorrectly

Discussion in 'General Discussion' started by kenrbnsn, Aug 3, 2017.

Tags:
  1. kenrbnsn

    kenrbnsn Active Member

    Joined:
    Feb 27, 2002
    Messages:
    33
    Likes Received:
    1
    Trophy Points:
    308
    Location:
    Hillsborough, NJ, USA
    Some of my users were having problems using SFTP and research via Google suggested that removing & reinstalling the openssh server would fix these problems, so I did the following from an SSH terminal session:

    Code:
    yum erase openssh-server
    yum install openssh-server
    /usr/local/cpanel/scripts/restartsrv_sshd
    
    This seemed to fix the SFTP problems that were being seen, but now when WHM tries to update my cPanel version, I get these errors and the update dies.

    Code:
    [2017-08-03 01:30:26 -0400]   Installing : openssh-server-5.3p1-122.el6.x86_64                          1/1
    [2017-08-03 01:30:26 -0400] E Error unpacking rpm package openssh-server-5.3p1-122.el6.x86_64
    [2017-08-03 01:30:26 -0400]
    [2017-08-03 01:30:27 -0400]
    [2017-08-03 01:30:27 -0400]   Verifying  : openssh-server-5.3p1-122.el6.x86_64                          1/1
    [2017-08-03 01:30:27 -0400]
    [2017-08-03 01:30:27 -0400]   Complete!
    [2017-08-03 01:30:27 -0400] E (XID zez2dj) The system failed to execute yum with the arguments “--assumeyes --config /etc/yum.conf install openssh-server” because of an error: The “/usr/bin/yum” command (process 19101) reported error number 1 when it ended. : Error unpacking rpm package openssh-server-5.3p1-122.el6.x86_64
    [2017-08-03 01:30:27 -0400]   checkyum version 22.3
    [2017-08-03 01:30:29 -0400] E Sysup: Needed system RPMs were not installed: openssh-server
    [2017-08-03 01:30:29 -0400] ***** FATAL: Cannot proceed. Needed system RPMs were not installed.
    
    How do I fix this problem? Is the fix as simple as

    Code:
    yum erase openssh-server
    
    And then let WHM reinstall the package?

    Thanks in advance.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    It's possible one of the files associated with that RPM is not writable. Could you run the below command and let us know the output?

    Code:
    lsattr /usr/sbin/sshd /usr/bin/ssh /usr/bin/scp
    Thank you.
     
  3. kenrbnsn

    kenrbnsn Active Member

    Joined:
    Feb 27, 2002
    Messages:
    33
    Likes Received:
    1
    Trophy Points:
    308
    Location:
    Hillsborough, NJ, USA
    Here is the result:
    Code:
    # lsattr /usr/sbin/sshd /usr/bin/ssh /usr/bin/scp
    su---a-------e- /usr/sbin/sshd
    su--ia-------e- /usr/bin/ssh
    -------------e- /usr/bin/scp
    
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Try removing the immutable bit from the /usr/bin/ssh binary to see if that helps. EX:

    Code:
    chattr -i /usr/bin/ssh
    Thank you.
     
  5. kenrbnsn

    kenrbnsn Active Member

    Joined:
    Feb 27, 2002
    Messages:
    33
    Likes Received:
    1
    Trophy Points:
    308
    Location:
    Hillsborough, NJ, USA
    I did that command:

    Code:
    # chattr -i /usr/bin/ssh
    # lsattr /usr/sbin/sshd /usr/bin/ssh /usr/bin/scp
    su---a-------e- /usr/sbin/sshd
    su---a-------e- /usr/bin/ssh
    -------------e- /usr/bin/scp
    
    I then tried to install the openssh-server via WHM. This is the result:
    Code:
    Loaded plugins: fastestmirror
    Setting up Install Process
    Loading mirror speeds from cached hostfile
     * cpanel-addons-production-feed: 72.29.88.74
     * base: mirror.nodesdirect.com
     * extras: mirror.cloud-bricks.net
     * updates: repo1.ash.innoscale.net
    Resolving Dependencies
    --> Running transaction check
    ---> Package openssh-server.x86_64 0:5.3p1-122.el6 will be installed
    --> Finished Dependency Resolution
    
    
    Total download size: 329 k
    Installed size: 702 k
    Downloading Packages:
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    
      Installing : openssh-server-5.3p1-122.el6.x86_64                          1/1
    Error unpacking rpm package openssh-server-5.3p1-122.el6.x86_64
     
    
      Verifying  : openssh-server-5.3p1-122.el6.x86_64                          1/1
     
    Complete!
    (XID q3ar7v) The system failed to execute yum with the arguments “--assumeyes --config /etc/yum.conf install openssh-server” because of an error: The “/usr/bin/yum” command (process 5767) reported error number 1 when it ended. : Error unpacking rpm package openssh-server-5.3p1-122.el6.x86_64
    
    Still not working. :(
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Please also remove the "a" attribute:

    Code:
    chattr -a /usr/sbin/sshd
    chattr -a /usr/bin/ssh
    Also, are you aware of how those attributes were applied to those files? If not, I recommend consulting with your provider or a system administrator as it's not standard for those attributes to be applied. It indicates a third-party application or a person with root access applied those attributes to prevent the system from changing those binaries.

    Thank you.
     
  7. kenrbnsn

    kenrbnsn Active Member

    Joined:
    Feb 27, 2002
    Messages:
    33
    Likes Received:
    1
    Trophy Points:
    308
    Location:
    Hillsborough, NJ, USA
    Thanks, that worked. As I said before, I screwed up by trying to fix the problem I was having and updated openssh-server incorrectly.

    Thanks for your help.
     
    cPanelMichael likes this.
Loading...

Share This Page