download Putty<\/a>.<\/p> easily.\r\n\r\n\r\n\r\nNo setup is required – it is a standalone executable. Run Putty, enter your IP address into the Host Name (or IP address) field, the port on which your server SSH service is listening, SSH for protocol, and then click on Open.<\/p>\r\n\r\n\r\n\r\n
You will be prompted to enter the user that you plan to access your server with and then the respective password.<\/p>\r\n\r\n\r\n\r\n
Linux\/Mac users on the other hand can use their build-in terminal and log into their server using the below command syntax:<\/p>\r\n\r\n\r\n\r\n
# ssh root@IP_address -p port_number<\/pre>\r\n\r\n\r\n\r\nThis example command will try to log into the server as root with the p<\/strong> argument being the port that the SSH service listens to. If you don’t use -p<\/strong> then it will try to connect on the SSH default listening port (22<\/strong>).<\/p>\r\n\r\n\r\n\r\nThere, so now you are logged into your server via SSH with the help of Putty or your terminal.<\/p>\r\n\r\n\r\n\r\n
One thing that springs to mind after the initial logging is: Where am I?<\/p>\r\n\r\n\r\n\r\n
To check which directory you are currently residing in, you can use the pwd<\/strong> shell command. For example:<\/p>\r\n\r\n\r\n\r\n# root@vps:~# pwd\r\n\/root<\/pre>\r\n\r\n\r\n\r\nPWD stands for ‘print working directory<\/strong>‘. As you can see from the output above, the current working directory for the root user is \/root<\/strong>.<\/p>\r\n\r\n\r\n\r\nNow let’s navigate to another directory from the Linux tree hierarchy. Let’s say that you want to be in the directory where all the OS configuration files can be found or \/etc<\/strong>. Type:<\/p>\r\n\r\n\r\n\r\n# root@vps:~# cd \/etc<\/pre>\r\n\r\n\r\n\r\nafter which you will immediately be in the \/etc directory as shown in the output below:<\/p>\r\n\r\n\r\n\r\n
# root@vps:\/etc# pwd\r\n\/etc<\/pre>\r\n\r\n\r\n\r\nNow you want to see what does this directory contains. Which files and directories are present. For that, you will need to list the content of the current directory. Use the ls command. This command has many options that you can combine. For example, if you want to list the files plus hidden ones by the time they are modified you can type:<\/p>\r\n\r\n\r\n\r\n
# ls -lat<\/pre>\r\n\r\n\r\n\r\nIf you used this command in the \/etc<\/strong> directory you will find it troubling to check the latest modified files due to the output from this command being large because of the many directories and files in place. Therefore use ‘less<\/strong>‘ in conjunction with ls -lat<\/strong>. Execute:<\/p>\r\n\r\n\r\n\r\n# ls -lat | less<\/pre>\r\n\r\n\r\n\r\n|<\/strong> is a pipeline that makes the output of one command serve as the input of another command which gives you possibilities to combine different commands altogether. So in the above example, you are combining the listing command with the less command which will list only a small number of the directories\/files in a single page output. To navigate and check the rest of the listing you can use Page Down<\/strong>. To quit this command use Q<\/strong>.<\/p>\r\n\r\n\r\n\r\nNow let’s go back up one directory. To do that use:<\/p>\r\n\r\n\r\n\r\n
# cd ..<\/pre>\r\n\r\n\r\n\r\nNow navigate to the \/root directory. Type:<\/p>\r\n\r\n\r\n\r\n
# cd \/<\/pre>\r\n\r\n\r\n\r\nWhat if you want to create a file? There are many ways to do that. To create a file type:<\/p>\r\n\r\n\r\n\r\n
# touch rosehosting.html<\/pre>\r\n\r\n\r\n\r\nThis will create a file that will be empty. To populate it you can use one of the many text editors in Linux such as vim<\/strong>, vi<\/strong>, nano<\/strong>, emacs<\/strong>, etc.<\/p>\r\n\r\n\r\n\r\nOf course, every text editor has its own modus operandi so feel free to use an editor according to your needs and knowledge.<\/p>\r\n\r\n\r\n\r\n
To create a directory use the mkdir<\/strong> command:<\/p>\r\n\r\n\r\n\r\n# mkdir \/opt\/wordpress<\/pre>\r\n\r\n\r\n\r\nThis creates a wordpress directory into \/opt<\/strong>. To delete the directory use rmdir<\/strong>. However you cannot use rmdir<\/strong> if the directory is not empty, so you will have to either empty the directory content first or use another command to delete everything along and inside the directory. We are talking about a very dangerous command that needs to be used wisely. You probably know already about ‘rm -rf’<\/strong> whose arguments instruct the command to delete everything in the path provided. So for the sake of the argument, let’s delete the newly created full wordpress<\/strong> directory.<\/p>\r\n\r\n\r\n\r\nFirst, check where you are with ‘pwd’<\/strong> to ensure that you are located where you should be or in the \/opt<\/strong> directory. If not there use the ‘cd’<\/strong> command to navigate to \/opt<\/strong>:<\/p>\r\n\r\n\r\n\r\n# cd \/opt<\/pre>\r\n\r\n\r\n\r\nThen list the content of the directory with ‘ls’<\/strong> and after you are sure that you are where you created the wordpress<\/strong> directory, execute:<\/p>\r\n\r\n\r\n\r\n# rm -rf wordpress<\/pre>\r\n\r\n\r\n\r\nThe above command will delete everything in the present wordpress<\/strong> directory. However, if you type \/wordpress<\/strong> instead of wordpress then it will delete a directory which if exists will be located in the Linux tree hierarchy as the output below shows:<\/p>\r\n\r\n\r\n\r\ndrwxr-xr-x 24 root root 4096 Jun 5 10:38 .\/\r\ndrwxr-xr-x 24 root root 4096 Jun 5 10:38 ..\/\r\ndrwxr-xr-x 2 root root 4096 May 31 15:18 bin\/\r\ndrwxr-xr-x 2 root root 4096 Apr 12 20:14 boot\/\r\ndrwxr-xr-x 6 root 500 680 Jun 5 08:12 dev\/\r\ndrwxr-xr-x 94 root root 4096 Jun 5 08:15 etc\/\r\ndrwxr-xr-x 4 root root 4096 May 18 20:12 home\/\r\ndrwxr-xr-x 12 root root 4096 May 13 22:34 lib\/\r\ndrwxr-xr-x 2 root root 4096 Apr 21 03:53 lib64\/\r\ndrwxr-xr-x 2 root root 4096 Apr 21 03:53 media\/\r\ndrwxr-xr-x 2 root root 4096 Apr 21 03:53 mnt\/\r\ndrwxr-xr-x 3 root root 4096 Jun 5 08:26 opt\/\r\ndr-xr-xr-x 72 root root 0 Jun 5 08:12 proc\/\r\ndrwx------ 12 root root 4096 Jun 5 10:24 root\/\r\ndrwxr-xr-x 17 root root 520 Jun 5 08:19 run\/\r\ndrwxr-xr-x 2 root root 4096 May 31 15:18 sbin\/\r\ndrwxr-xr-x 3 root root 4096 May 17 19:33 srv\/\r\ndrwxr-xr-x 7 root root 0 Jun 5 08:12 sys\/\r\ndrwxrwxrwt 9 root root 4096 Jun 5 10:35 tmp\/\r\ndrwxr-xr-x 10 root root 4096 Apr 21 03:53 usr\/\r\ndrwxr-xr-x 12 root root 4096 Apr 29 10:18 var\/\r\ndrwxr-xr-x 2 root root 4096 Jun 5 10:38 wordpress\/<\/strong><\/pre>\r\n\r\n\r\n\r\nTo rename a file you can use the ‘mv’<\/strong> command.<\/p>\r\n\r\n\r\n\r\nFor example, let’s rename the created rosehosting.html file. Since you were located in the root directory when you created the file using touch, you now have to use the following command to rename the file:<\/p>\r\n\r\n\r\n\r\n
# mv \/root\/rosehosting.html \/root\/bestmanagedvps.html<\/pre>\r\n\r\n\r\n\r\nSo, you use mv<\/strong>, then the file you want to rename, and then the value to which you want to rename the file.<\/p>\r\n\r\n\r\n\r\nmv<\/strong> can also be used to move files from one directory to another. Example:<\/p>\r\n\r\n\r\n\r\n# mv \/root\/bestmanagedvps.html \/var\/www\/html<\/pre>\r\n\r\n\r\n\r\nwhich will move the bestmanagedvps.html<\/strong> file into \/var\/www\/html<\/strong><\/p>\r\n\r\n\r\n\r\n