Basic SSH Manual

Basic SSH Manual

With SSH access, you can work with your files and directories securely, connecting from an application or command-line interpreter. Below we provide an example of a command-line interpreter for each of the most commonly used operating systems: 
  • Windows: from cdmon we recommend downloading the Ubuntu terminal on your Windows device. It can be downloaded completely free of charge from the Microsoft Store. Download Ubuntu Terminal on Windows
  • Linux: you can use the operating system's own terminal to connect to the machine.
  • Mac: this operating system also allows SSH connections through its own terminal.
 
1.-Activate the SSH connection
To connect to the server you must enter the SSH access credentials. You can view these details in the SSH access icon within the hosting management in your cdmon control panel.
 
 
Open the command terminal, where you must enter the following syntax to connect to the server:
  1. ssh username@server_IP or server_name
 
An example connection using the data from the previous screenshot:
 
Next, it will ask for the password. You must type the password you set when activating SSH access in your control panel.
 
When the connection is established, you will see the terminal with the following format:
 
 
You can start working with your default folder, which by default will be /entrada. You can check your location at any time using the pwd command:
 
 
If you are in the /entrada folder and want to access the management of your website files, you must exit the /entrada folder with the command:
  1. cd ..
 
Once outside, you can access the /web folder with the command:
  1. cd web
 
Located in the /web folder, you can view all the directories and files of your website by using the command ls -la. With this command you will obtain results similar to the following:
 
 
2.-Basic commands
Below is a list of the basic commands for working with files using an SSH connection:
 
  • cd: the path you want to access.
  • ls: lists the contents of all files and directories.
  • rm: deletes a file.
  • mkdir: creates a new directory.
  • rmdir: deletes a folder.
  • pwd: shows the location of the current path.
  • cp: copies a file to another directory.
  • mv: moves files between folders.
  • more: if you perform a search with many results, this command allows you to view the results in sections.
  • unzip: extracts compressed files.
  • ftp: connects to upload/download files from your local computer to the server.
  • mysql: allows you to work with databases and perform exports/imports of content.
  • exit: exits the remote machine you are connected to.
  • clear: clears all the information displayed on the screen.
 
3.-SSH user permissions
When you start working with the SSH user, you must control the permissions assigned to each directory, since folders created via FTP or SSH have the same user and belong to the same group.
 
Below is an example of a folder created by FTP and another created by SSH:
 
 
Assign permissions 775 to the directories:
 
 
With this modification, you can work with the same directory from both SSH and FTP. 
 
Note: when SSH is activated, the owner of the /home folder of your hosting is modified.
This prevents creating directories in the root of the site through FTP. You can create directories inside the /web folder.
 
What commands can I use from SSH?
 
If you press the tab key twice, the command console will show all the commands available with your SSH user:
 
 

For more information, you can contact us.
    • Related Articles

    • How to activate SSH access

      In versions higher than PHP 7.3, instead of the SSH/SFTP button, another button called "Developer hosting" will be available, through which these two options, as well as Git, can be activated. To do so, you must follow the instructions in the ...
    • Add SSH public key

      SSH keys are a secure and efficient way to authenticate on remote servers without having to enter a password each time you connect. If you need to generate an SSH key, especially on Windows, we recommend using PuTTY, a tool that allows you to easily ...
    • SSH key update

      This guide describes how to remove warnings that may appear when trying to connect to your domain/web server through SSH. The warning referred to in this guide is the "host key mismatch". It should look similar to the following: ...
    • Operation of the basic list of services

      When you access the cdmon Control Panel, you enter the "Basic service list". This list shows the services you have contracted and the following improvements to make managing your services easier: Easier and faster management. Color scheme to easily ...
    • How to organize the basic list of folder services

      In the basic services list you can organize all your products by creating folders to group them according to your needs. Below we explain how it works. Create folders First, you need to create a new folder. To do this, access your cdmon control panel ...