--------------------------------------------------------------------------------------------------------------- ---------------------------------
0. Real-computer remote management of virtual machines
Telnet plaintext Transmission TCP 23
SSH encrypted transmission TCP 22
ssh-x [email protected]//real machine remote management SERVER0 virtual machine
ssh-x [email protected]
View virtual machine version and kernel
cat/etc/redhat-release//view version
Uname-r//View kernel
Cat/proc/meminfo//View memory
--------------------------------------------------------------------------------------------------------------- ----------------------
To permanently configure an alias file:
Alias n= ' ls-l '//temporary configuration alias, will disappear after reboot
So for some commonly used and more complex commands, you can use a permanent configuration alias file
Example: ssh-x [email protected]
ssh-x [email protected]
VIM/ROOT/.BASHRC//Modify the. bashrc file under root (. xx for hidden files)
#. BASHRC
alias s= ' ssh-x [email protected] '
Alias d= ' ssh-x [email protected] '//Set alias to D
# User specific aliases and functions
Alias rm= ' Rm-i '
Alias cp= ' Cp-i '
Alias mv= ' Mv-i '
Alias Zh= ' convmv-r-f gb2312-t UTF8--notest '
# Source Global Definitions
if [-F/ETC/BASHRC]; Then
. /etc/bashrc
Fi
[[email protected]/]# alias//view aliases
Alias cp= ' Cp-i '
alias d= ' ssh-x [email protected] '
Alias egrep= ' Egrep--color=auto '
Alias fgrep= ' Fgrep--color=auto '
Alias grep= ' grep--color=auto '
Alias l.= ' ls-d. *--color=auto '
Alias ll= ' Ls-l--color=auto '
Alias ls= ' ls--color=auto '
Alias mv= ' Mv-i '
Alias rm= ' Rm-i '
alias s= ' ssh-x [email protected] '//Set Success
Alias Which= ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde '
Alias Zh= ' convmv-r-f gb2312-t UTF8--notest '
--------------------------------------------------------------------------------------------------------------- --------------------
Fixed Save host Name:
Hostname WW//Set host name disappears after shutdown or reboot
[[email protected] ~]# vim/etc/hostname//Modify etc hostname file
desktop00.cn//Modify host Name
[[email protected] ~]# cat/etc/hostname//view hostname file
desktop00.cn
[[Email protected] ~]#//modified successfully
---------------------------------------------------------------------------------------------------------- -----------------------------
Configure IP address, subnet mask, gateway address
(1) Modify etc under Ifcfg-eth0 file,
Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0
BOOTPROTO=DHCP//
Onboot=yes
Type=ethernet
Userctl=yes
Peerdns=yes
Ipv6init=no
Persistent_dhclient=1
(2)
[[email protected "~]# nmcli connection show //View network card name
name uuid Type device
[[email protected "~]# nmcli Connection modify ' System eth0 ' ipv4.method manual ipv4.addresses ' 172.25.0.22/24 172.25.0.254 ' connection.autoconnect yes //Modify the Eth0 IP address to 172.25.0.10
/24, Gateway to 172.0.254
connection.autoconnect Yes //boot auto start
[[email protected "~]# nmcli connection up ' System eth0 ' // Activating network configuration
device=eth0 //Device name
bootproto=none //manual configuration
onboot=yes //Auto start on each boot
type=ethernet
Userctl=yes
Ipv6init=no
Persistent_dhclient=1
ipaddr0=172.25.0.10 //IP Address
prefix0=24 Subnet mask
gateway0=172.25.0.254 //Gateway
Defroute=yes
ipv4_failure_fatal=no
name= "System eth0"
Uuid=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
--------------------------------------------------------- ---------------------------------------------------------------------------------
Package Management:
Mount:
Mkdir/rhel7
Mount/dev/cdrom/rhel7
Ls/rhel7
Ls/rhell7/packages
Rpm-q Firefox//query package is installed
Rpm-ivh/rhel7/package/firefox. Install packages
RPM-E Firefox/uninstall Package
--------------------------------------------------------------------------------------------------------------- ----------------------------
Yum Package Management/automatic resolution of dependencies
* Server with client in a piece
(1) Service side. Mount the optical drive device so that the system appears
(2) Local client, modify configuration file, specify local as server
Vim/etc/yum.repos.d/ww.repo //Modify ECT, Ww.repo file
[WW]//Specify warehouse name
NAME=WW//Warehouse Information description
BASEURL=FILE///RHEL7//Specify Local as server, RHEL7 directory
Enabled=1//Open this document
Gpgcheck=0//Do not turn on signature authentication
Yum Clean all//clear Yum Cache
Yum repolist//Column Warehouse
Yum-y Install Firefox//installation software
Yum-y Remove Firefox//uninstall software
* Server-side separation from client
(1) The service side has been completed. Classroom build Web services, CD-ROM all content
(2) Specify the Yum warehouse service on the server
Vim/etc/yum/repos.d/ww.repo
[WW]
Name=ww
baseurl=http://172.25.254.254/content/rhel7.0/x86_64/dvd/
Enabled=1
Gpgcheck=0
--------------------------------------------------------------------------------------------------------------- ---------------------------------
6. Using the wget download tool
URL URLs for------wget software packages
URL of the------wget Package-o/destination path/new file name *.rpm
[email protected] ~]# Firefox 172.25.254.254
[email protected] ~]# wget http://172.25.254.254/content/rhel7.0/x86_64/errata/Packages/ Kernel-3.10.0-123.1.2.el7.x86_64.rpm-o/opt/ker.rpm
[Email protected] ~]# ls/opt
kernel-new.rpm ker.rpm RH Ww.txt
--------------------------------------------------------------------------------------------------------------- --------------------------------
7. Configuring a permanent DNS server
vim/etc/resolv.conf (tab)//Enter etc under res (tab) file O
NameServer 172.25.254.254
This article is from the "13392236" blog, please be sure to keep this source http://13402236.blog.51cto.com/13392236/1976561
Dahne 10.26linux Basic Learning Notes