Secure Shell, or SSH, is a command-line method of connecting to your webspace. This is a crucial feature for power users since it allows them to run commands and manage files. To utilize SSH, you must connect to the server using an SSH client. Once you’ve connected to a terminal program, you can run commands manually.
A terminal or Shell client with SSH is used to connect to the server. If you’re using Windows, you can get an SSH client like PuTTy. On the other hand, if you’re using Linux or macOS, you can utilize Terminal.
If you have a command prompt, type ssh, followed by your shell username (cPanel username), the @ sign, and the name of your server.
Once you’ve logged in, you can run PHP commands, move files, edit files, and do a lot more. Our system supports key-based authentication, which is far more secure than simply using a password. You will also save time because you will not have to type it every time. Simply create a private key and a machine, and then upload the contents of the public key to a file called.ssh/authorized keys. If you want any assistance, please do not hesitate to contact us.
There are a few fundamental commands you should know once you’ve logged in.
There are two key commands that you should utilize to navigate your hosting area. The following are the commands:
ls -lah – This command will list all of the files in the folder you’re now in, as well as some additional information about the files, such as permissions, the time and date they were created/last modified, and their size.
Pwd – This command will help you avoid getting lost by listing the path you’re currently on.
To make a new file, simply touch [filename.ext]. Remember to include the extension, such as.txt, at the end of the filename.
Use the command mkdir [directoryname] to create a new directory in the current directory.
Less skilled users can edit files with the default nano program. For example, you can open the file in nano by typing nano [filename].txt, and you can view the full instructions by clicking Ctrl+G or F1.
Although vim can be used to edit files, it is normally utilized by more sophisticated users.
Vim [filename].php, for example.
You can use cat in conjunction with grep to find text within a file. Because the necessary text will be outlined, you will have an easier time finding it.
For example, cat [filename.txt] | grep “Aug 15 10:22” displays the contents of [filename.txt] with a break grab and outlining text matching “Aug 15 10:22.”