Putty is an open-source SSH client used to connect to a remote server. This article describes how to connect to your Hosting account securely using SSH.
What is SSH Access? [IMPORTANT]
Secure Shell (SSH) is a protocol that provides secure command-line access to your hosting account. By using SSH, you can remotely log in to your hosting account and run commands as if you were sitting right at the server.
To connect to your account using PuTTY, follow these steps:
In the Host Name (or IP address) text box, type the hostname or IP address of the server where your account is located.
The default port for SSH is 22.
Confirm that the Connection type radio button is set to SSH.
A PuTTY security alert about the server’s host key appears the first time you connect. Click Yes.
Enter your account username when prompted and then press ENTER.
Type your account password when prompted and then press ENTER.
You can now run commands. For example, to see a listing of the current directory, type ls and then press ENTER.
To close the SSH connection when you are done, type exit and then press ENTER.
Basic SSH Commands [UPDATED]
In this step, we will go through the main/most commonly used shell commands that you should learn about!
ls – This command is used to list all files and directories. Another useful option is -a, this will also show all the other files as well, which includes hidden files/directories (dotfiles with a . in front of them, for example, .ssh directory).
cd – This command is used to “walk” between directories (cd stands for “change directory”). Enter the command cd home and you will instantly change your current location to “home”. You can try using the ls again to see that the information which was outputted to the screen has changed.
mkdir – This command is used to create a new directory (stands for “make directory”). It simply creates a new directory with your chosen name, for example, mkdir NewFolder will create a new directory with the name “NewFolder” in your currently active directory (where you are right now).
rm – This command is used to remove a chosen file/directory. For example, rm NewFile will remove the previously created file named “NewFile”. If you wish to remove a directory and all the directories inside of it, use rm -r NewFolder, this will delete the folder “NewFolder” and all the other folders inside of it.
cat – This command is used to display the contents of the file. For example, cat info.txt will bring the contents of the file to the screen.
pwd – This command shows your current location in the file system. For example, type pwd, the output could be something like this: “home/user/public_html“.
cp – This command is used to copy files and folders.
mv – This command works the same way as cp, but instead, it moves the file instead of copying it. This command can also be used to rename the file.
find – Now this command is used to search folders for a file or files that meet given criteria (name, size, file type). For example: find . -name "*.html"
vi/nano – This command is used to enter a text editor.
history – This command is used to display the last used commands. For example: history 20 will show the last 20 entered commands in the Terminal.
clear – This command clears all the text from the Terminal screen.
wgetis used to download files from the internet. For example, to fetch a file from the internet and store it in your current directory. use command: wget http://fileurl/filename.ext
We hope this article was clear enough to make you understand the basic SSH commands and how to use them.
If you have any questions or queries, feel free to leave them in the comments section below.