Updated: February 1, 2024
I keep seeing this issue come up inside the helpdesk (as well as on Stack Overflow), so I thought I’d save us all sometime by doing a guide on how to connect to your NameHero hosting account via SSH and SFTP. The first part of this guide will walk through how to do it while using a Mac. If you are using Windows, skip to this section.
If you want access, you need to open a new support ticket to ask our team enable it for you. Please provide them with the cPanel username you wish to set it up on.
We do this for security, to validate you only have good intentions in mind.
Once it’s enabled by our support team, you can follow the guide to connect.
Mac: Generate Your Public Key
When connecting to SSH or SFTP at NameHero password authentication is disabled.
This means you must add your public SSH key inside of cPanel and authorize it to connect.
To get started, you first need to have a key generated on your computer.
If you see a file called id_rsa.pub then you already have a key, you just need to copy it to your clipboard:
pbcopy < id_rsa.pub
If you don’t, you can easily generate one with the following command in your Mac terminal:
ssh-keygen -t rsa -C "[email protected]"
Using your email address allows you to easily be able to identify the SSH key.
If you’re using a Windows machine, you may find this easier using PuTTY to generate the key.
Mac: Add Your Public Key To cPanel
Once you have your public key on your clipboard, you need to go to cPanel -> SSH Access:
Then click on Manage SSH Keys:
You then want to Import Key:
You’ll notice they also have a section to Generate a New Key, but I personally rather generate those on my computer so it stores everything in the correct place (see above).
Next, you just need to paste your public key in the selected box:
As long as you’re using a public key, you don’t have to worry about the other text fields.
I suppose you could put a name for the key if you plan on having multiple if it’s not already contained in your public key file.
Once your key has been imported, you then need to go back and authorize it by clicking on Manage:
On the next screen you’ll be able to Authorize it:
Congratulations! At this point your public SSH key has been added to your cPanel account and you’re ready to connect via SSH or SFTP.
Mac: Connect To SSH
If you’re using a Windows machine, you may wish to use the PuTTY SSH client.
If you’re using a Mac (like me) I recommend using a new Terminal window which is found inside the Utilities folder:
To connect, you’ll need:
Server Hostname: node201.namehero.net (please note this depends on what server your account is on)
Port: 2200 (maybe different depending on your server, kindly ask support if 2200 doesn’t connect)
Username: Your cPanel username
You will not need your password.
To connect via the Mac terminal you would type something like this:
ssh -p 2200 [email protected]
Congratulations, you’re now ready to use SSH.
Now please note, if you don’t have experience with SSH, you probably shouldn’t be in here. You can seriously mess up some stuff if you’re not careful! So please keep this in mind!
Mac: Connect To SFTP
SFTP is a secure file transfer program that you can use in place of FTP to ensure the safest connection.
If you don’t have an FTP client, I recommend downloading Filezilla as it’s a good free one.
Once you have it downloaded, you’ll need to set it up to use your private key you setup in the first step.
To do this, open Filezilla and click on Filezilla -> Settings -> SFTP (using a Mac):
You can then click on the Add key file… button.
Then, hold down Shift+Command+G and type in ~/.ssh
You will then be inside the folder that contains your private key and you can click on it and click Open:
Congratulations, you’ve added your SSH key to Filezilla.
To setup an SFTP connect, open up your site manager and use the settings noted above (in SSH) to look something like this:
You’ll notice once you select Logon Type: Key file it will get rid of the password option and will use the SSH key.
You’ll also want to make sure your Host is the correct server name and the port is 2200 (or maybe different depending on your server. Kindly contact support if this doesn’t work).
That’s it! You can now connect and begin using SFTP to upload/download your website files.
Windows: Want to Setup SSH and SFTP on a PC with FileZilla?
- If you are a NameHero customer, open a support ticket and make sure SSH is enabled on your cPanel account. By default, all SSH access is disabled on all accounts. Once confirmed that SSH has been enabled on your account, continue to the next steps.
- Open your web browser and visit this site to download PuttyGen
- Once installed run it and click on the “Generate” button:
- Once the key generates, go ahead and put something in the Key comment to identify the key you just created. Then save the public and private keys in a location you can easily find on your computer. Remember ‘where’ you placed the private key as you’ll need that exact location later in FileZilla in step 15!
- Now that you have saved both the public and private keys, it’s time to copy the top part of the PuttyGen screen over into cPanel! Highlight the text here and Cntrl C to ‘copy’ it to your memory.
- Now login to your cPanel account, search for SSH at the top.
- Now click on ‘Manage SSH keys’:
- Now click on ‘Import Key’:
- On this step, where it ask for the ‘name’ of your key, you can leave it blank as it will default to id_dsa, but if you will have multiple keys and such, why not name it something you can remember? For this example, I have chosen ‘mylaptop’.
- We are only importing your public key, so only paste your ssh key from step 5 in the bottom portion as you see here! On this screen, if you have saved your cpanel user/pass in your browser, your browser may be trying to auto populate the name and pass. You can remove all that and leave it like the example below and hit ‘import’ at the bottom.
- If you see this, you are almost done! Now click on ‘Back to Manage Keys’.
- Find your new public key and click ‘Manage’:
- Now click on ‘Authorize’:
- At this point, you are done in cPanel. Now it’s time to open FileZilla and get you connected!
- Create a ‘new’ login. Choose SFTP. Enter in the nodeXXX.namehero.net of where your account is located. You can find out what node you are on in cPanel on the right side where it says ‘Server Information’ or ask one of our friendly techs in NameHero chat!. Enter in the port: 37980 (check with NameHero on exact port for your particular server!) Login type, choose Key file. For the user, put your cPanel username. Then, from Step 4 where you saved your public and private keys, browse to the location of your ‘private’ key. Click ‘ok’. DO NOT click ‘Connect’. FileZilla won’t save it unless you first click ‘Ok’. Once you do that, go back to the connection and click ‘Connect’.
- Upon first connecting to your account, you will get a ‘pop up’ message about a certificate. You will save to accept and continue. You will only be asked this one time.
- You should be able to connect using your keys and continue about your day!
Video Tutorial: How To Setup SSH And SFTP At NameHero (On A Mac)
I’ve filmed a video tutorial if you’d like to follow along these steps with me using my Mac:
Feel free to let me know if you have any questions or run into problems!
Ryan Gray is the founder and CEO of NameHero, one of the fastest growing independent web hosts in the United States. Ryan has been working online since 1998 and has over two-decades experience in Internet Entrepreneurship.