Search blog

Showing posts with label cPanel. Show all posts
Showing posts with label cPanel. Show all posts

Tuesday, January 19, 2016

Steps for Creating SSH Connection in Ubuntu 14.04

1. First you should generate an SSH key pair on your Linux distribution. Open up your terminal and execute the following commands:

 user@localhost: ssh-keygen -t dsa  
 Generating public/private dsa key pair.  
 Enter file in which to save the key (/home/user/.ssh/id_dsa): (just press Enter here)  
 Enter passphrase (empty for no passphrase):  
 Enter same passphrase again:  
Once you've entered the passphrase you will see the following message as below:
 Your identification has been saved in id_dsa.  
 Your public key has been saved in id_dsa.pub.  
 The key fingerprint is:  
 16:8e:e8:f2:1d:c9:b9:cf:43:9a:b3:3c:c1:1f:95:93 user@localhost  

This will create a private key written to /home/user/.ssh/id_dsa and a public key written to /home/user/.ssh/id_dsa.pub. The passphrase is used to protect your key. You will be asked for it when you connect via SSH.

2. If you are using cPanel then log into it and open the SSH section. Then open the file 'id_dsa.pub' in a text editor like Gedit. The file will be located at '/home/user/.ssh/id_dsa.pub.' The '.ssh' directory might be hidden so press 'CTRL+H' to view hidden files & folders. Select ALL & COPY the content of the file inside the box with the label 'Public Key (DSA only):' Look at the image below.



3. Logging in to your Web Hosting account via SSH in Linux:

 user@localhost: ssh-add /home/user/.ssh/id_dsa  
 Enter passphrase for id_dsa:  
 Identity added: id_dsa (id_dsa)  

(The passphrase is the same as the one you have set during the generation of the SSH key in Step 1).

Then you should initiate an SSH connection:

user@localhost: ssh USER@HOST_NAME -pPORT

  • USER - the user for which you want to establish the SSH connection; this will be the same username as the one you use to log in to your cPanel.
  • HOST_NAME (or IP address) - here you should enter the host/IP of the server to which you wish to connect (e.g. siteground300.com);
  • PORT - the port for the connection - here you should enter the port provided by your Web Host; try something like -p18765
Press "Enter" and if everything has been set up properly, you will establish an SSH connection to your account.

Saturday, June 20, 2015

[Solved] cPanel Mailbox Running Out Of Space/Getting Filled! What To Do?

If you are on a Shared Hosting Account using cPanel as your Server Management Tool and use its' Web Mail feature, then often you might have landed into this precarious situation where you find yourself running out of Mailbox space after a certain period of time. That's if you begin to get loads of message running into thousands! And once your mailbox is filled your mail starts bouncing and the only option that remains with you is either to backup your mails in your local computer or delete some of your old mails. But again a time comes where you find yourself ---- back to square one with your mailbox filled!!! Also may be you would not want to delete all your mails and like to keep all/some of your mails with you.

So, today I finally have found an easy work around which will cost you not a single dime, save your lots of worry and precious time.

To achieve this we will use Gmail's variety of features and it's better you create an unique Gmail id for the email account you are trying to create a backup.I am sure the same can be done using Hotmail/Outlook and may be even Yahoo.

These handy features of Gmail will allow us to:
  1. Import all our mails from our Remote Server to it's inbox retaining all the originals in the Hosting Server (provided you select the option to retain all message in the web host, while configuring Gmail.)
  2.  Create an 'alias' to the above Email Account in Gmail so that you can reply from your Gmail account as though you were using the above Email Account.
  3. Create an automatic forwarder in the Web Host so that all the mails get automatically forwarded to your Gmail (This is optional --- read below to know why.)

    Out of personal experience I know this is a better choice than storing your mails in your local computer because if your computer happens to crash or experience data loss you will have no worry whatsoever about loosing your mails as all your mails will be in the Gmail Server.
Step 1:  Importing the Emails from Web Host to your Gmail Account

As in the above figure first click on Settings

Click on Accounts & Imports

Click on Import mail and contacts a Window as below will pop out.

Saturday, May 30, 2015

[Solved] Configure SSH, PuTTy in Ubuntu 14.04, 14.10, 15.04 to Connect from Localhost to Remotehost

Solutions to Successfully connect to a remote server using SSH in Ubuntu & cPanel account


After fiddling around with a lot of this and that the solution below is what eventually worked for me. I tried PuTTY SSH client and all that but eventually I found it simple and best to use the default Ubuntu Terminal. Anyway PuTTY is just a GUI client which you use instead of using the Terminal.

1. Generate SSH Key in Linux

Open your terminal and enter the following commands:
 $ ssh-keygen -t dsa  

You should get the output as below:
Note: When asked to enter file name simply hit enter without enterning any file name so that your file is named 'id_dsa' automatically.

Then enter  a strong passphrase and make sure you remeber it for future use.
 Generating public/private dsa key pair.  
 Enter file in which to save the key (/home/user/.ssh/id_dsa):  
 Enter passphrase (empty for no passphrase):  
 Enter same passphrase again:  
 Your identification has been saved in id_dsa.  
 Your public key has been saved in id_dsa.pub.  
 The key fingerprint is:  
 11:2e:e8:b2:1d:c9:b9:cf:76:9a:b3:3a:c1:1f:95:93 user@localhost  


This will create a private key written to /home/user/.ssh/id_dsa and a public key written to /home/user/.ssh/id_dsa.pub. The passphrase is used to protect your key. You will be asked for it when you connect via SSH.

 2. Upload Public Key to your cPanel Account

Open the file 'id_dsa.pub' in a text editor like Gedit and copy it's content.

Now log into your cPanel Account, Open SSH/Shell Access and Paste as shown in the image below.

If you don't do this you will get an error saying 'Permission denied (publickey).'

3. Time to Connect to your Remote Server Account

Now load your private SSH key using the following command:
 $ ssh-add /home/user/.ssh/id_dsa  

When asked to enter the passphrase enter the passphrase that you have set during the generation of the SSH key.

Now initiate your SSH connection by using the following commands:

 $ ssh Username@Hostname -pPort_Number  

where,
  • Username is your cPanel username or Webhost Account Username
  •  Hostname can be your server's IP address or domain name or your server's name
  • Port_Number is default is '22' or could be something like '18765' as set by my Webhost Provider.
Press "Enter" and if everything has been set up properly, you will establish an SSH connection to your account.

Top 5 Posts (Weekly)