Configuring ssh for shared server

mgfrobozz

New Member
Trying to get ssh access working for a shared instance (I'm brand-new to interserver, have been using ehosts and AWS linux/ubuntu).

I created a password-protected public and private key in cpanel, downloaded them to ~/.ssh in my system (ubuntu 18.04 lts), authorized the public key in cpanel, and deleted the private key from cpanel (leaving a user-only read-only key in ~/.ssh). I'm now trying to ssh to the IP number (shown as "104.xxx.xxx.xxx" below) that I've been given for the new instance.

"ssh 104.xxx.xxx.xxx" hangs indefinitely.
"ftp 104.xxx.xxx.xxx" works fine.

I have port 22 open in iptables for the appropriate NIC on my client machine, and ssh works to my AWS machines.
Should I be using a different IP number? If so, where do I find that number?

Note that I have not yet transferred my domain name to that IP number; do I need to transfer the domain name first, and use that (ie, "ssh my_domain_name.com" for the access? (If so, I'll have longer downtime for the domain as I'm getting it set up and tested on interserver.)

Also, when I get the ssh port-22 access working, I'd like to change the port number (as I've done in AWS), since port 22 attracts lots of break-in attempts from China/Russia/Korea/etc. Is there a way to do this?
 
Last edited:

mgfrobozz

New Member
It's changed a little now (a few hours later). After "ssh 104.xxx.xxx.xxx", it prompts for a password, but won't accept the password associated with the public/private key pair.

I discovered that that DSA (interserver's default key format) is deprecated in ubuntu ssh version 7.0 and greater, so I switched to RSA keys instead. I generated these on my ubuntu system, installed the public key on interserver, authorized it, and used ftp to check that the key appeared in ~/.ssh and in ~/.ssh/authorized_keys in interserver.

Still no luck. It keeps reverting to password mode; it shouldn't, since the key has been added in the client (via ssh-add) and the password given. In the trace below, it reports that it should accept publickey authentication. When I do provide the password for the key, it rejects it.

Any ideas?

Code:
> ssh -v -i /home/xxxxx/.ssh/id_rsa -u krieglab 104.xxx.xxx.xxx
debug1: Host '104.xxx.xxx.xxx' is known and matches the ECDSA host key.
debug1: Found key in /home/xxxxx/.ssh/known_hosts:11
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)

debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)

debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:MxnbojSVDHIvIK37xCoXctw1dVosOfThLZH86upbjc8 /home/xxxxx/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: password
krieglab@104.xxx.xxx.xxx's password:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
krieglab@104.xxx.xxx.xxx's password:
 
Last edited:

mgfrobozz

New Member
Fixed now. I needed to submit a ticket to interserver, and they then reported "SSH has been enabled for user xxxxx" (I don't know what changes they had to make).
 

Quags

Administrator
Staff member
Hello,
SSH is available but not enabled by default. There is an access list, so only enabled user's can access ssh (essentially allowusers in sshd_config).
 

kumkum

New Member
Fixed now. I needed to submit a ticket to interserver, and they then reported "SSH has been enabled for user xxxxx" (I don't know what changes they had to make).

I just want to include the steps to enable SSH for user on server, that's why i am posting my reply to this old post.
You can check below steps to enable SSH through WHM:
Step 1: Login to WHM.

Step 2:
Search for the menu Account functions and it opens in new window. There you can see multiple options and choose manage shell access from there.

shell.png



Step 3: In this step, you will be in right position to disable or enable the shell access. Here, you can see multiple accounts created by you and many user lists. Select the account or user for whom you want to enable or disable the shell access.

shell2.png



Select what type of shells you want to give access too.

Again, here is another tip to enable or disable shell access using modify account:

Step 1: In the WHM main page, select the Account function menu and then click on modify account.

shell3.png



Step 2: In modify account page, you can see the list of accounts in cPanel. Choose to which user you want to modify the account and then tap on modify.

shell4.png



Step 3: After clicking on the modify, you will get a screen displaying with few details such as privileges, limitations and further details

Below permission part, there is a save button. Just tap on it to save entire process.

I hope this information is worth.
 

Pistle

New Member
SSH (Secured Shell) is a secure way to connect and administer Linux servers. With an SSH connection you can securely transfer files to your servers, monitor disk usage, setup a cronjob and perform many more operations.

In order to use SSH you need to:

  1. Enable SSH from your Control Panel
  2. Connect to the Server with a Username, Password and an IP address
Enable SSH
Step 1: Log in to your control panel. Learn how.
Step 2: Navigate to the Order Information view.

Type the Domain Name of the order in the search field on the homepage, select Order from the drop down and click on Search.

Step 3: Enable SSH Access
  • Click on the Shell Access link.
  • Click on Enable Now
Connect to the Server
Windows OS
  • Download any SSH client like WinSCP or PuTTY.
  • Enter your IP address and the port number 2222
  • Log in with your cPanel username and password.
Linux OS
To connect to the server via SSH, run the following command from a terminal:

ssh -p 2222 cpanelusr@ip.add.re.ss

Replace cpanelusr with your username; and replace ip.add.re.ss with your IP address.

Mac OS
To connect to the server via SSH, run the following command from a terminal:

ssh -p 2222 cpanelusr@ip.add.re.ss

Replace cpanelusr with your username; and replace ip.add.re.ss with your IP address.
 
Top