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.

How to enable SFTP?

Discussion in 'General Discussion' started by Spetsnaz, Aug 31, 2012.

  1. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I have tried everything turning off my firewall adding my IP to white list of all I can think of and still cannot connect with SFTP.
    I have given me "normal shell" "jail shell" access and still nothing.
    I want to connect via port 22 since one of my clients want SFTP but I cannot turn it on or make it work.

    Code:
    Response:	fzSftp started
    Command:	open "USERNAME@37.0.xxx.xx" 22
    Command:	Pass: *******
    Status:	Connected to 37.0.xxx.xx
    Error:	Fatal: unable to initialise SFTP on server: could not connect
    Error:	Could not connect to server
    Status:	Waiting to retry...
    Status:	Connecting to 37.0.xxx.xx...
    Response:	fzSftp started
    Command:	open "USERNAME@37.0.xxx.xx" 22
    Command:	Pass: *******
    Status:	Connected to 37.0.xxx.xx
    
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Please ensure the following line is added to the /etc/ssh/sshd_config file:

    Code:
    Subsystem	sftp	/usr/libexec/openssh/sftp-server
    Make sure it's not commented out. Remember to restart the SSH service if you make any changes.

    Thank you.
     
  3. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Code:
    Status:	Connecting to 37.0.124.66...
    Response:	fzSftp started
    Command:	open "spetsnaz@37.0.124.66" 22
    Command:	Pass: *******
    Status:	Connected to 37.0.124.66
    Error:	Connection closed by server with exitcode 1
    Error:	Could not connect to server
    Status:	Waiting to retry...
    Status:	Delaying connection for 1 second due to previously failed connection attempt...
    Status:	Connecting to 37.0.124.66...
    Response:	fzSftp started
    Command:	open "spetsnaz@37.0.124.66" 22
    Command:	Pass: *******
    Status:	Connected to 37.0.124.66
    Error:	Connection closed by server with exitcode 1
    Error:	Could not connect to server
     
  4. dolphyn

    dolphyn Well-Known Member

    Joined:
    Nov 27, 2001
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
  5. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    1) What is that?
    2) I can connect to ssh with port 22, but i disabled ssh for users
    3) I read that and still nothing.
     
  6. dolphyn

    dolphyn Well-Known Member

    Joined:
    Nov 27, 2001
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    sshd is the SSH daemon. If you can connect via SSH, it's running.

    If SSH completely disabled for users, maybe that locks them out of SFTP as well. I don't know.
     
  7. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    It's fine.
    Also my mail system is not sending e-mails.
    After I install litespeed, mod_security, and CSF
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    What is fine? Did you get it working? If so, what did you do to fix it?

    As for sFTP, have you tried using TLS (FTPES in FileZilla) instead? It is encrypted and doesn't require a shell to function.

    As for the next statements about mail not sending, is this a new issue? If so, please definitely feel welcome to open up a new thread. Threads should be on the same topic whenever possible.

    Thanks!
     
  9. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Yes it got fixed, because I could actually send e-mails to gmail.
    So I just have to contact the Microsoft part. Also for FTPES in filezilla where is this located?
    And 1 more question, how do I check who is connect via shh right now and who has connect to root?
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    In FileZilla, if you use Site Manager to configure a connection, you have the option for FTPES in the Server Type dropdown (the default is FTP).

    As for SSH, you can run "w" command without the quotes to see who is logged into the machine.
     
  11. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    thank you and with "w" it will show all the loggins attempted or only of the currently on?
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Per it's definition by running the "man w" command:

    It's only for active logins. You can review past login/ssh activity in the following files:

    Code:
    /root/.bash_history
    /var/log/secure
    Thank you.
     
  13. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Thank you again for all the help.
     
  14. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You can also get a good breakdown of logins using "last" command. This command shows all users who logged into SSH successfully at some point on the server.
     
Loading...

Share This Page