Centos Knowledge Points Notes - Beginner's Reference

1. Change the problem of slow telnet login:
cd /etc
vi resolv.conf
to clear the contents

2. Change the root user cannot log in directly remotely:
cd /etc
cd pam.d
vi login
Comment out this line
#auth required pam_securetty.so // This line is commented out.
It is best not to use it, because it directly cancels the authentication of the root security module. If you can't log in remotely with ssh, go to /etc/ssh/sshd_config to change the relevant content

3. Mount the USB mobile hard disk
to move the The hard disk is mounted.
#df View the hard disk drive letter under Linux
mount /dev/sda1 /mnt/usb (example)

5. Change whether to use the graphical interface or the character interface when Linux starts up
cd /etc
vi inittab
to id:5:initdefault: where 5 Represents the default graphical interface
Change id :3 :

initdefault: 3 to represent the character interface For which machines are used, note that the IPs are separated by commas




For example:
hosts allow =192.168.1.110,192.168.1.120

9. It is forbidden to use CTRL-ALT-DELETE to restart the machine in the background
cd /etc/inittab
vi inittab Find the following line in the file
# Trap CTRL-ALT-DELETE
ca::ctrlaltdel: /sbin/shutdown -t3 -r now (comment out this line)
such as: # Trap CTRL-ALT-DELETE
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now

10. Modify the hostname
vi /etc/sysconfig/ network Modify the HOSTNAME line to HOSTNAME =hostname
vi /etc/hosts Fill in the 127.0.0.1 space with the same hostname
as above. Situation df -m   df -h is more user- friendly 14. Check the size of the directory du -sh dirname 15. Unzip Xiaoquan tar xvfj lichuanhua.tar.bz2 tar xvfz lichuanhua.tar.gz
















tar xvfz lichuanhua.tgz
tar xvf lichuanhua.tar
unzip lichuanhua.zip

16. Display memory usage
free –m

17. Forgot root password, if it is grup
1. When the grup screen appears, use the up and down keys to select which item to start Linux, Press the e key
2. Press the up and down keys to select kernel /boot/.... Then press the e key
3. Modify the command you see now, add single Result:
kernel /boot/vmlinuz-2.4.20-8 single ro root=LABEL=
4. Press Enter to return, press the b key to start, and directly enter the linux command line.
Direct execution: passwd root
to change the password, your password will be done.
If it is lilo: press Tab, the screen will appear lilo Type: linux single, press Enter

18. Display the system How long has it been running
uptime

19. Restart the network
/etc/init.d/network restart

20. Display the contents of the POST command
dmesg

21. View ports
netstat –an
netstat -anp

22.. Detailed list of ports
/etc/ services

23. Check the physical information
lspci

24. The installation graphical interface cannot appear, use parsing to install
Linux lowres (640X480 resolution is used)

25. Block the ping command of the host because others cannot ping your machine
echo 1 > /proc/ sys/net/ipv4/icmp_echo_ignore_all

26. Completely delete the programs installed by Oracle, delete several directories
/etc/oraInst.loc /tmp/ /etc/oratab $ORACLE_BASE/*

28.RPM package
1. Uninstall RPM -e
2. query rpm -q
-a query all installed packages
-f query the package of the software containing the file
-i show the package information
-l show the file list of the package
3. verify rpm -v
rpm -Va verify that the entire file is missing Which files Use rpm –qf when
encountering do
n’t recognize mysql or mysql-3.23.54a instead of mysql-3.23.54a.rpm) 5. What files are included in an has not been installed: use rpm --qip ***.rpm




An installed software package: use rpm –qi ***.rpm

29. Look at the installed character set
locale -a

30. Capture packet command tcpdump
Example: capture all data received and sent by the host of 192.168.1.32 The package
tcpdump host 192.168.1.32
intercepts a specific port
tcpdump tcp port 21 host 192.168.1.32

31. Chinese support for the text section
RH 9.0 comes with the installation package zhcon_0.2.3_1.rh9.i386.rpm After
the installation is complete, execute: zhcon Support Chinese

32. Check what program is running on the port
lsof –i:8001

33. Check the real-time log
tail –f /var/log/messages

34. When mount appears dead
1. fuser –m /mnt/share find out The process of the program, and then Kill
2. Then umount /mnt/share

35.linux to control the windows
1. Use RH9.0 to bring your own rdesktop, the version is 1.2.0
Command: rdesktop –u user –f 192.168.1.70 color default It is 8-bit
2 to achieve 16 colors, it is necessary to download the new version 1.3.0
rdesktop –a 16 –u lichuanhua –g 800*600 192.168.1.70

36. Linux mount Windows partition
mount ntfs partition
1. Stand-alone Windows NTFS partition
1. Search and download kernel-ntfs-2.4 on www.google.com. 18-14.i686.rpm
2. rpm -ivh kernel-ntfs-2.4.18-14.i686.rpm
3. mkdir /mnt/share
4. mount -t ntfs /dev/hda1 /mnt/share
to mount windows Partition, first create a new directory /mnt/share, modify /etc/fstab, and add it at the end (assuming Windows is installed on the first partition of the hard disk)
/dev/hda1 /mnt/share ntfs defaults 0 0
2. On the network Windows and linux machines, the linux machine mounts the shared file on
windows windows IP: 192.168.1.1
1. linux mounts the shared file dbf on 192.168.1.1 (windows), and mounts it in the /mnt/share directory of linux, in / Create a share directory under mnt
mount -t smbfs -o username=massky,password=massky //192.168.
1.1/dbf /mnt/share
2. The machine restarts and mounts automatically, and vi /etc/fstab is added last:
//192.168.1.1/dbf /mnt/share smbfs defaults,auto,username=
massky,password=massky 0 0

37. Oracle9i installation on Linux9.0
1. Make sure the RPM development package, use the following command to check whether it is installed These packages
rpm -q gcc cpp compat-libstdc++ glibc-devel glibc-kernheaders binutils
2. Unpack
zcat Linux9i_Disk1.cpio.gz | cpio -idmv
zcat Linux9i_Disk2.cpio.gz | cpio -idmv
zcat Linux9i_Disk3.cpio.gz | cpio - idmv
3. Set the kernel parameters
vi /etc/sysctl.conf, add the following parameters
kernel.shmmax=4294967295 The
calculation method of memory 512M is: kernel:shmmax=1024*1024*RAM(M)/2
Execute sysctl -p to take effect
4. Establish data directory and user
groupadd dba
groupadd oinstall
useradd –g oinstall –G dba oracle
passwd oracle

mkdir /opt/oracle
mkdir /opt/oracle/product
mkdir /opt/oracle/product/9.2.0
chown –R oracle.oinstall /opt/oracle
mkdir /var/opt/oracle
chown oracle.dba /var/opt/oracle
chmod 755 /var/opt/oracle
5.vi .bash_profile 设置变量
export LD_ASSUME_KERNEL=2.4.1
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/9.2.0
export ORACLE_SID=ora9i
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH

export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORAC

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326928775&siteId=291194637