Learning Record 002-Simple instructions

Source: Internet
Author: User
Tags gpg i18n syslog

First, scattered offal

1. View the system version Uname-a
Uname-m
2. Zoning conditions
IDE interface/DEV/HD HDA First disk
scsi:sas/sata/ssd/dev/sd* SDA SDB and the like
1p+le (4 L)//p Primary partition E extended partition L logical partition p+e<=4 E up to one or no L partition only starting from 5
3.ssh not connected to Linux solutions
Check firewall/etc/init.d/iptables stop//temporary shutdown
Chkconfig iptables off//permanently off
Ping Linux IP is on behalf of the physical connection is good
Telent linux_ip <= = Connected Pass, the service does not pass
4.touch ' Seq-s "" 20 30 '//create 20 to 30 files, "" with spaces in the middle of the logo
5.CP (common parameter-P hold property-A or-r copy directory)
RmDir (Delete empty directory)
Head view the number of lines at the beginning of the file, default 10 rows (-N.-N is numeric)
Cat >1.log (Edit 1.log)
or cat >>1.txt<<eee
Fefe
Dee
Eee//eee can be changed at will, but must be the same.
Cat/dev/null >1.log//emptying 1.log files
Cat 1.log 2.log >3.log//compositing new files
Echo-n Eee//-n No Line break
Echo-e "De\td\ne"//-E with some escape characters \ t \ n are empty lines and line breaks mean

Second, the system initial adjustment

1.root do not use the general situation
Useradd Kaka//create Kaka user
echo "123456" |passwd--stdin Kaka///behind--stdin means that the previous password action takes effect here
Su-//switch User-must be added, which means to add the environment variables up
2. To upgrade the system, with the domestic Yum source relatively fast
We can put the CD configuration of the Yum source, or you can provide others with Yum source
Method One:
/BIN/CP CENTOS-BASE.REPO.KAKA/ETC/YUM.REPOS.D
Cd/etc/yum.repos.d
/BIN/MV Centos-base.repo Centos-base.repo.save
/BIN/CP Centos-base.repo.oldboy Centos-base.repo
Method Two:
Direct download Sohu provides a configured Yum installation source configuration file.
cd/etc/yum.repos.d/
/BIN/MV Centos-base.repo Centos-base.repo.ori//backup meaning
wget website
/BIN/MV Centos-base-sohu.repo Centos-base.repo//replace Yum source
RPM--import/etc/pki/rpm-gpg/rpm-gpg-key*
Yum Upgrade//Upgrade
3. Install the necessary software Yum Grouplist//See what package groups are installed after Yum groupinstall "baoming"//Problem Solving
Yum install Lrzsz sysstat-y//lrzsz upload downloaded command package system performance monitoring tuning tool
4.runlevel View current Run level
Cat/etc/inittab//There is a display running level in this
5. Boot entry NTSYSV or setup and scripts
Just finished loading the system reservation
Timed Task Crond
Networking Network
Remote service sshd
System logging Software syslog
If you msconfig settings under Windows, feel free to do so.
The scripts are:
lang=en//Prevent display of Chinese
For Kaka in ' chkconfig--list|grep 3:on|awk ' {print '} ';d o chkconfig--level 3 $kaka Off;done
For Kaka in Crond network syslog sshd;do chkconfig--level 3 $kaka On;done
Chkconfig--list|grep 3:on
6. Visudo//equivalent/etc/sudoer But the command mode is more secure, in any case can only set root permissions and all root permissions
User Machine= COMMANDS
User Machine = (rights granted to which user)/etc/sbin/useradd
Root all= (All) all//If the command is separated by commas and spaces/etc/sbin/useradd,/etc/sbin/userdel
Root all= (All) Nopasswd:all//similar to setting a root user without password input and then using sudo-to see what permissions they have
7. Echo $PATH//View the user's environment variables, such as with which Useradd will show the path of the Useradd command usr/sbin/useradd that is because there are usr/sbin in path
If you want to add a path that does not have an environment variable, you need to edit
Vi. bash_profile//user's environment variables
. . bash_profile
Source. Bash_profile the two commands are the same, reloading
8. Change the SSH configuration
Cd/etc/ssh/sshd_config
VI!$
Port 52113//ssh The default connection port, instead of the one nobody knows
Permitrootlogin no//root the user knows, still telnet
Permitemptypasswords No//disable blank password login
Usedns no//Do not use DNS
After joining,/etc/init.d/sshd restart NETSTAT-LNT view port, or lsof-i: 52113 to see what service the port has
9. How to adjust the character set
cat/etc/sysconfig/i18n//View the code for the default character set, such as lang= "en_US. UTF-8 "
Cp/etc/sysconfig/i18n/etc/sysconfig/i18n20160623.bak//Back up the current file
Echo ' lang= ' ZH_CN. GB18030 "' >/etc/sysconfig/i18n//replace the inside file
cat/etc/sysconfig/i18n//See if the replacement was successful
source/etc/sysconfig/i18n//can replace source with. Let it take effect
echo $LANG//Confirm the operation is successful
The final step client putty also needs to be adjusted

Learning Record 002-Simple instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.