Ifconfig
Ifconfig eth0
Ifconfig eth0 172.16.191.246 netmask 255.255.255.0 up
--------------------------------------------------------------
/etc/sysconfig/network-scripts/ifcfg-eth0
# advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
Device=eth0
Onboot=yes
Bootproto=static
ipaddr=172.16.191.246
netmask=255.255.255.0
gateway=172.16.191.1
dns1=
Dns2=
---------------------------------------
See if a file exists ls specified file, if no will error
Configuring DNS information,/etc/resolv.conf
NameServer 114.114.114.114
NameServer 202.98.96.68
PWD: Print current full path currently
[Email protected] ~]#
---------------------
First paragraph: representing the user name
Second paragraph: @
Third paragraph:
Fourth: Representative directory name, short path
Full path: The long path must be from/
Short path: Represents the current directory name
Create file: Touch file name 1 file name 2
Create directory: mkdir directory name 1 directory name 2 directory name 3
-----------------------------------------------------
-rw-r--r--1 root root 0 12-17 02:47 1.txt
User groups
-rw-r--r--//Represents the type and permissions of the file
First group: File types
-Representative documents
Catalog D
L on behalf of linked files
-------------------------------------------
R Read, read can be viewed using commands, for example: Cat command
W Write, write can edit the file if Vi,rm
X Execute, execute can run, execute, just like the EXE in Windows
---------------------------------------------------------------------
The order of permissions is always rwx, if any, write the permission character directly, if not, use-represents
-rwxrwxrwx
3 Groups of permissions
First group: RWX represents the permissions of the file owner user abbreviation U
Group Two: Permissions for a group called G
Group III: On behalf of other people others abbreviation O
----------------------------------------------------------------
-rw-r--r--
0---
1 001--x
2 010-w-
3 011-WX
4 r--
5 101 R-x
6 rw-
7 111 rwx
0~7 is represented by the 8 binary.
---------1.txt 000 000 000 with 8 binary to represent 000
1.txt Permissions 000
-----------------------------------------------------------------------
-rwx r-x r-x 1 root root 188 12-17 02:21 1.sh
1.sh is 8 binary to indicate 7 5 5
------------------------------------------
643
110 100 011
RWX r---WX
---------------------------------------------------------
View Host Name: hostname
Modify host Name: hostname hostname//For example jw40, need to re-login temporarily effective, restart after failure
Modify host Name: Config file/etc/sysconfig/network//Changed after reboot takes effect
Networking=yes
Networking_ipv6=yes
Hostname=jw40
Change Password:
passwd//Change password, for root, enter the new password directly
--------------------------------------------------------------------
To create a user:
Can only be created by the root user
Useradd User Name
AddUser User Name
AddUser is a link file for Useradd
[Email protected] ~]#
# represents the root user
$ on behalf of ordinary users
/home/user01
The home directory for ordinary users is named after the name of their user name
User02 's home directory:/home/user02
The user's information is stored in/etc/passwd, where a line represents a user, through: segmented, the first field represents the user name
User's password information/etc/shadow
CAT-N option to display line numbers
----------------------------------------------------
Useradd--help//View Help information
Mans Useradd//manual
Useradd User01//Create USER01 user, default is no password, no password is unable to login
passwd User01//Set Password
User group Information/etc/group
Cp/etc/passwd/opt
---------------------------------------------------
Settings for permissions
Rwx
User U
Group G
Others o
-------------------------------------
User01 edit passwd file, cannot edit because there is no write permission
-rw-r--r--1 root root 1503 12-17 04:33 passwd
The third paragraph represents the User01 user
chmod o+w passwd
chmod o-w/opt/passwd
chmod 644/opt/passwd
Root
@
Root
~ Representative home directory for the root user, he represents the/root directory
For User01 users,/home/user01
The last section represents the directory, the short directory
~
Opt
Local
VI If you want to delete a line
DD//Delete a row
Uppercase two ZZ//can also save exit
User creation and Permissions