Website Management SSH Common Commands

  
 

Traditional network service programs such as FTP POP Telnet and so on are inherently insecure because they transmit data and even user accounts and user passwords in clear text on the network, which is easily intercepted by fake middlemen and SSH is Secure. Shell is currently a reliable protocol for providing security for remote login sessions and other network services. The SSH protocol can effectively prevent information leakage during remote management. All SSH data can be encrypted and prevented. DNS and IP spoofing. Another advantage of SSH is that the transmitted data is compressed so that it can speed up the transfer. Of course, SSH has many functions. It can replace Telnet and provide a secure channel for FTP POP PPP. It is often used for website development. SSH to the remote server to perform some operations, since SSH is only a secure session protocol, then the specific commands that can be executed depend on your remote server type. Here are some of the most commonly used developments when using Linux class server websites. Some of the command memos that come to it are actually some of the commands commonly used in Linux OS
…… forgetting the parameters of a command during use can use the –help parameter to display a simple help message. This is very practical, and the SSH client can use a small open source free client called PuTTY. First, the compression and decompression tar command can be used to compress the file directory or decompress the tar format file. The specific command is: compress [tar -czvf compressed file name.tar compressed file or directory name] decompress [tar -zxvf compressed file.tar The compression ratio of this format is generally higher than the RAR below Windows
, and most Linux servers do not need to support the decompression of RAR compressed files. The gunzip command can be used to decompress the gz format file: unzip [gunzip compressed file name.gz] The zip command can be used to decompress the zip format file. The specific command is: compression [zip -r compressed to file name.zip is compressed Directory] Unzip [unzip compressed file name.zip] Unrar installation method is as follows: wget http://dag.wieers.com/rpm/packages/unrar/unrar-3.6.8-1.el5.rf.i386.rpm; Rpm -Uvh unrar-3.6.8-1.el5.rf.i386.rpm; Copy the above command and execute it under root. Basic unrar usage: unrar x -o- -y 54NCR.com.rar /home/www.54ncr.com/(to 54NCR.com.rar file, extract to /home/www.54ncr.com directory. Pay attention to decompression directory The unrar can be decompressed with /end: Assume that the file name of the first volume is 54NCR.r00, and all the volumes are in the same directory. Then directly unrar x -o- -y 54NCR.r00 /home/www.54ncr.com/Second, the common operation of the file cp command that copy copy files and folder format: [cp is copied file target] Several common parameters -a will copy attributes such as file permission status as much as possible; parameter -f can delete the target with the same name before copying. The scp command copies the file advanced commands and can copy remote files. Usage: usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file][-l limit] [-o ssh_option] [-P Port] [-S program][[user@]host1:]file1 [...] [[user@]host2:]file2 For example, copy all files and folders in upload to the public folder: scp - r upload/puclic/mv command Move Move file can also be used for renaming: [mv is moved file target] Rename operation can be performed when the target name is file name; rm command is remove delete file and folder: [rm deleted file Or directory] This operation will not be recoverable. In addition, wildcards such as * are also supported. The -rf parameter can be used to skip any warning messages. The chmod command can modify the file permissions: [chmod 755 modified file] Usually, most folders on the web server have the permission of 755 files as 644. Chown Modify the user and user group properties of files and folders 1. To modify the owner of the file hh.c. Modify this user to sakia all chown sakia hh.c so that the user access rights of hh.c are applied to sakia as Owner 2, change the owner and group of the directory /tmp/sco to sakia and group netchown -R sakia:net /tmp/scochmod modify the file and folder read and write execution attribute 1, modify the hh.c file to Writable and readable executable chmod 777 hh.c to modify all the file attributes in a directory to be writable and readable executable chmod 777 *. * replace the folder name and suffix with *. Similarly, if you want to modify the attributes of all htm files chmod 777 *.htm2, change the directory /tmp/sco to writable and readable executable chmod 777 /tmp/sco to modify all the folder attributes in a directory to be writable Read executable chmod 777 * Replace the folder name with * to modify all the files and folders under /tmp/sco and its subfolder properties to be writable and readable executable chmod -R 777 /tmp/Sco readable r=4 can be written w=2 executable x=1777 is to have full authority. Users and groups can be freely combined as needed. The first, second, and third digits represent themselves, the user group, and others. For example: chmod 700 secure.php means that only access to secure.php is allowed, and user groups and others have no access. Third, the common operation of directory browsing ls command can list the current address of the directory and file situation is somewhat similar to the DOS dir command, I personally prefer the parameter -alh ie all list human to list all files and humanize display file size units, etc. The three parameters can also be used separately. Query the properties of a file can use the ls -l file name; the properties of the query folder can use the ls -ld folder name; the properties of all files in the query folder can be jumped to using the ls -alh folder name cd command A path parameter is a cd command with a relative path or an absolute path similar to DOS. Fourth, the server remote download wget almost all foreign servers have installed this command to download the Internet file directly from the remote: [wget downloaded file] This operation is very convenient when updating the CMS system such as: wget http://wordpress. Org/latest.tar.gz will download the latest version of the Word
Press archive directly from the public network. The server is directly connected to the server, so the CMS can also use version control such as SubVersion. To update. V. Common operations of the database The mysqldump command can be used to back up the data of the MySQL database: backup [mysqldump -h host -u user -p password database > backup file .sql] restore or import database [mysql -h host -u user -p password The database < backup file. sql] database backup and restore operations support remote operations, that is, the data host can not be the current host.

Copyright © Windows knowledge All Rights Reserved