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.

SSH works, but SFTP does not

Discussion in 'General Discussion' started by columbusgeek, Feb 2, 2012.

  1. columbusgeek

    columbusgeek Member

    Joined:
    Nov 30, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi all

    I was securing a server today, going though the usual steps. Adding CSF, etc. I was logged in via SFTP as well as SSH in a terminal window with no problems.

    I made a change to /ssh/sshd_config and saved it and restarted the service. Turns out the edit I made was incorrect in some way and would not allow SSH to restart. This of course locked me out of making any changes via SSH or SFTP.

    Pretty big bummer eh?

    It was a dumb mistake, I admit. Anyhow, I discovered you can reset your SSH configuration by going to the "fix your SSH" url. (http://server-ip:2086/scripts2/doautofixer?autofix=safesshrestart)
    I can now login via SSH, but SFTP does not work. Transmit, (my ftp client) tells me that "the user name or password was not accepted by the server". Odd since I can login with that username (root) and password via SSH

    I tried a cpanel force upgrade and it didnt help.

    Any ideas? It's not the client, I tried another as well.
     
  2. hoststop

    hoststop Well-Known Member

    Joined:
    Dec 6, 2011
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bolton, UK
    cPanel Access Level:
    Root Administrator
    You need a KVM to access server's console. This will help you to fix and troubleshoot things further. Contact your DC OR webhost to connect KVM.
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,622
    Likes Received:
    24
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Can you post the contents of your /etc/ssh/sshd_config file here? Please remove any lines that are commented out so that the file is smaller and easier to read.

    I am thinking that this line might be missing from the file:

    Code:
    Subsystem	sftp	/usr/libexec/openssh/sftp-server
    It is typically at the bottom of the file and allows sFTP access. If it is missing, sFTP wouldn't work.
     
  4. columbusgeek

    columbusgeek Member

    Joined:
    Nov 30, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thanks cPanelTristan

    I was able to login via ssh using the url fix, and once I did that, I navigated to the sshd_config file, found the error in the line I made and repaired that, restarted, then SFTP was back in business.
    I think when I was looking for the mis-entered line yesterday I must have overlooked it somehow.

    Too much caffeine.

    Thanks again.
     
Loading...

Share This Page