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 problems

Discussion in 'General Discussion' started by ekg, Apr 2, 2008.

  1. ekg

    ekg Member

    Joined:
    Feb 22, 2008
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    i am trying to create ssh access for a perticular site and i follow all the steps in the tutorial but can not seem to connect. I even downloaded the cyberduck instructions but it asks me for a password. Is this the same password that i use for my standard ftp account or a different one. It has been driving me crazy, and when i create a key it does not accept it. What am i doing wrong?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Do you have root or reseller access to the server? You can only issue SSH access via the WHM interface, even then only 1 shell user per cPanel account.
     
  3. LiNUxG0d

    LiNUxG0d Well-Known Member

    Joined:
    Jun 25, 2003
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gatineau, Quebec, Canada
    Hi there,

    Here's my best way of explaining what you're trying to do.

    - Firstly, make sure your SSH port (standard port 22 usually) is open in your firewall.
    - Secondly, make sure sshd is running on the server, by trying to connect to it using PuTTy.

    Download PuTTy: http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

    Alright, now that you know you can connect to the SSH server and that it's up, running and secure, log in using your clear text user name and password. You should do this only once, and it's when you setup the keys.

    Once logged in, make sure you're in your /home/user/ directory:

    Code:
    [user@server ~]$ pwd
    /home/user
    
    Once you're in that directory, issue a `ls -al` command (no quotes) and look for a directory called ".ssh". If it isn't there:

    Code:
    [user@server ~]$ mkdir .ssh
    [user@server ~]$ chmod 700 .ssh
    
    Now that you have that directory, change directory to it and issue the following:

    Code:
    [user@server ~]$ cd .ssh
    [user@server .ssh]$ ssh-keygen -t rsa
    
    This will prompt you with a series of questions. For simplicity purposes, just hit enter every time, leave them blank... you should end up with something like:

    Code:
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/user/.ssh/id_rsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/user/.ssh/id_rsa.
    Your public key has been saved in /home/user/.ssh/id_rsa.pub.
    The key fingerprint is:
    aa:aa:ba:aa:aa:62:e1:55:d3:77:05:75:68:53:91:61 user@hostname
    
    Now, do a `ls -al` once again, no quotes, you should see:

    Code:
    [user@server .ssh]$ ls -al
    total 20
    drwx------  2 user user 4096 Apr  3 09:33 ./
    drwx------  3 user user 4096 Apr 26  2007 ../
    -rw-------  1 user user  887 Apr  3 09:33 id_rsa
    -rw-r--r--  1 user user  237 Apr  3 09:33 id_rsa.pub
    
    Now, do the following:

    Code:
    [user@server .ssh]$ cp id_rsa.pub authorized_keys
    [user@server .ssh]$ chmod 700 authorized_keys
    
    Download the id_rsa file to your home computer.

    To configure PuTTy for keyless entry:

    - Enter the IP and the port of the ssh server you just configured this on.
    - Click on the "Data" area on the left, put your server username in.
    - Click on the node (+) beside "SSH" in the left menu.
    - Click on "Auth" beneath SSH.
    - Under "Private Key File for Authentication" select the id_ras which you downloaded from your server in a step above.
    - Click on the "Session" item in the left menu in PuTTy.
    - Under "Saved Session" on the right side of PuTTy, add a name to save this session as and click "Save"

    The session should now be in the white textbox, ready to double-click to connect, any time.

    I hope you find this tutorial complete. I did it while typing it so I know it works. I'm sure someone else has one on these forums, but for accuracy, I thought it best that I do it step by step to be 100% sure of what I'm writing.

    Warmest regards, let me know!
     
    #3 LiNUxG0d, Apr 3, 2008
    Last edited: Apr 3, 2008
  4. ekg

    ekg Member

    Joined:
    Feb 22, 2008
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Thanks a whole heap..i will try that today. I am using a mac but i will hook up a windows machine to try out putty. By the way about my firewall, i can connect to my server via ssh using cyberduck on a mac no problem ???
     
  5. LiNUxG0d

    LiNUxG0d Well-Known Member

    Joined:
    Jun 25, 2003
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gatineau, Quebec, Canada
    Hey there,

    I guess I didn't pay attention to "Cyberduck" when you mentioned it, however, in short, SFTP uses the SSH sub-system so I don't think there will be any issues, as long as you configure Cyberduck to use the 'id_rsa' file as the RSA Key for authentication. Technically, keys are universal as long as the application supports the SSH protocol and RSA/key authentication.

    :)

    Also, to configure it, as per Cyberduck's Help system:

    URL: http://cyberduck.ch/help/en/howto/ssh.html

    Replace "in your .ssh directory" with "that you downloaded (id_rsa) from the server when you created the keys".

    Let me know how this goes for you,
     
Loading...

Share This Page