VPS novice Linux tutorial: SSH remote management /common commands /file upload download

  
This article aims to teach the first contact with VPS novice, if you are a veteran. Can leave, there are some basic knowledge inside. It mainly includes logging in with BitviseTunnelier and transferring files via SFTP.

First of all, you have to download and install, not to mention here. Click on me to download.

First, open the main page, enter HOST is your IP, port default 22, user default root, password see you open mail. Note that you can check the Store... under the password, so you don't have to enter your password every time:



Second, Options under Login is After logging in, open the program. The default is SSH and SFTP. If you don't need SFTP, you can cancel it. Then, click on the bottom login to login:



3. You will be prompted to save HOTKEY. Accept and Save:



4. After the login is successful, 2 new windows will pop up, one for the command line window and one for the SFTP window. The command line window is the most commonly used, usually used to install software, compilers, etc. Another SFTP window can be used to transfer files.



I will not elaborate on the SFTP window. The FTP software used in peacetime is the same. You can upload or download the files of this machine. Practical, pay attention, do not know which file is actually used before deleting the file, otherwise it may cause VPS error.

Next, I mainly talk about the most commonly used commands in SSH:

1. The top command can view the system status in real time:



The focus area is the load average of the first row is the system load, that is, the entire VPS resource occupancy. If the station is built normally, there are rarely more than 5, and the BURST exceeds 20 will be the number. The first of the third row, this is the CPU occupied resources. There is also the latter??%wa this is the state of the hard disk, under normal circumstances, the CPU is best not to exceed 30%. The wa index is more than 30% for a long time. Basically, the hard disk is not in a state of strength. The fourth row is memory, how much, how much is used, and how much is left.

Press ctrl+c to stop executing the current program and return #.

2.wget command download file, for example:
wget http://cachefly.cachefly.net/100mb.test

3.vi command This is an editor, similar to WIN Notepad Notepad:
vi /etc/ssh/sshd_config

Simply talk about the use of VI, after vi file, press i, the insert will be displayed in the lower left corner, this time you can modify This file. After modification, press esc in the lower left corner of the insert to disappear, then enter: the lower left corner appears:, then enter x, press Enter, then save and exit.

Remove the # (comment) in front of Port 22 and modify Port 1688. Then, executing service sshd restart will modify your default SSH port number to 1688 to enhance security.

4. After the chmod command # is the description of this command
chmod +x /home/auto.sh # Give auto.sh executable permissions chmod -R 777 /home/wwwroot # give /home/Wwwroot write permission (required for some website programs)

5.mv command to move files
mv /home/wwwroot/abc.tar.gz /home/backup # Put abc.tar. Gz move to the backup directory

6.rm command to delete files
rm test.tar.gz # Delete test.tar.gz, you will be prompted to confirm y rm -rf /home/wwwroot/Test # No prompt to delete the test directory directly, do not mess with, remember.

7.tar command C package and X extract files
tar zcvf test.tar.gz /home/wwwroot #package /home/wwwroot tar zxvf tet.tar.gz # Extract the test in the current directory .tar.gz

8. Unzip the zip file package
unzip name.zip

Other common commands
cd Example: cd /home/wwwroot # Enter a directory ls # View Current directory file echo nameserver 8.8.8.8 >> /etc/resolv.conf #Set dns to G

When you enter the command incorrectly, ^HH^H2 may appear garbled, ctrl+c Interrupt the current operation and come back again.

Copyright © Windows knowledge All Rights Reserved