With SSH access, you can work with your files and directories securely, and with connection from an application or command interpreter. Here is an example of a command interpreter for each of the most used operating systems:
1.-Enable SSH connection
In order to connect to the server you must enter the access data by SSH. You can view this data in the SSH access within the management of the accommodation in your control panel of cdmon.
Open the command terminal, where you must enter the following syntax to connect to the server:
ssh Username@IP_server or server name
An example of connecting to the data from the previous screenshot:
ssh example@123.123.123.123
He then asks for the key. You have to type the key you entered in activating SSH access in your dashboard.
When you establish the connection, you display the terminal in the following format:
You can start working with your default folder, which will be/entry by default. You can check your location at all times using the pwd command:
If you are in the/entry folder and want to access the management of your website's files, you have to exit the folder/entry with the command:
cd ..
Once outside you can access the /web folder with the command:
cd
Located in the /web folder, you can view all the directories and files on your website by activating the ls -la command. With this route we achieve results similar to the following:
2.- Basic commands
Here's a list of the basic commands for working with the files via SSH connection:
cd:the route where you want to access.
ls:lists the content of all files and directories.
rm:deletes file.
mkdir:create a new directory.
rmdir:delete folder.
pwd:location of the current route.
cp:copy a file to another directory.
mv:moves files between folders.
more:If you search with many results, this command lets you view the broken results.
unzip:unzip the compressed files.
ftp:connect to upload/download files from our local computer to the server.
mysql:allows you to work with databases, and exports/imports of content.
exit:leaves the remote machine where you are connected.
clear:clean up all the information you have on the screen.
3.- SSH user permissions
When you start working with the SSH user, you must monitor the permissions you have assigned to each of the directories, as folders created by FTP or SSH have the same user, and they belong to the same user.
Here's an example of a folder created by FTP and another by SSH:
Assign 775 permissions in directories:
With this modification, you work with the same directory from SSH and FTP.
Note:When activating the SSH modifies the owner of the /home folder of your accommodation.
This prevents creating directories at the root of the site via FTP. You can create directories within the /web folder.
What commands can I use from SSH?
If you type twice on the tab, the command console will show you all the commands available with your SSH user: