当前位置:网站首页>Rhcsa day 9
Rhcsa day 9
2022-07-04 10:17:00 【Attiude】
Just signed in Linux when , First start /etc/profile file , Then start... In the user directory ~/.bash_profile、~/.bash_login or ~/.profile One of the documents
Order of execution by :~/.bash_profile、~/.bash_login、 ~/.profile.
If ~/.bash_profile If the document exists , In general, it will also carry out ~/.bashrc file .
/etc/profile >>>> Of all users
.bash_profile>>>> Current user
/etc/.bashrc>>>> Home catalog

User's environment variable configuration :
[[email protected] ~]$ ls /root/.bashrc # It is recommended to set it in this file first
/root/.bashrc
[[email protected] ~]$ ls /root/.bash_profile
/root/.bash_profile
Global environment variable configuration :
[[email protected] ~]$ /etc/profile
[[email protected] ~]$ /etc/bashrc
[[email protected] ~]$ /etc/profile.d/
To initialize or display the loaded content after login , Put the script file in /etc/profile.d/ Then you can ( No need to load execution rights limit )
1. Create a normal variable local_data=1 And access

Create environment variables root_data, Only root Users can access
[[email protected] ~]# vim .bashrc
[[email protected] ~]# echo $root_data
1

Create environment variables normal_user_data, Only ordinary users can access

Create environment variables root Both users and ordinary users can access

2. establish 3 File test1.txt, test2.txt, test3.txt
Use find lookup test1.txt,test2.txt, test3.txt

Use the alias : Name the above command myfind
To take effect automatically every time you log in , Add alias to /etc/profile or ~/.bashrc in . then # source ~/.bashrc . To make every user effective, alias , Add alias to /etc/bashrc Back most , then # source /etc/bashrc

Remove alias

3. View recently used 10 Historical orders

4. Print on one line 123 And from root Switch to normal user

5. Wildcard usage
establish 3 File file1, file2, file3
1.* To match 3 File 2.? matching 3 File

3.[] matching file1 and file3
4.[^] matching file2
5.[!] matching file2

6.{} matching file1 and file3

6. Examples of the use of quotation marks : No quotes , Single quotation marks , Double quotes , The quotation marks ,$()


7.linux Type of user in
linux Type of user group in
Super user's UID——0
System user's UID——1~999
For ordinary users UID——≥1000
linux Which file stores user information in ? And what do the fields mean
User account file ——/etc/passwd passwd It's a text file , Used to define the user account of the system , Because all users are right passwd Have the right to read , So this file Only user accounts are defined in , Without saving the password .
passwd In file : Each line defines a user account Field meaning Login name Login name Encryption port Make Use SHA-512/SHA-256/MD5 The password encrypted by the algorithm ,
If it is empty , Indicates that the user can log in without a password ,
if “*” Indicates that the account cannot be used to log in to the system
if “!!” Indicates that the account password has been locked Finally Time modification Time Date of last password change , With distance 1970 year 1 month 1 The number of days in a day means At the very least Interval How many days can the password not be changed . The default value is 0, Means unrestricted Maximum time Interval How many days must the password be changed . The default value is 99999, It means that there is no restriction When warning between How many days in advance to warn users that the password will expire , The default value is 7 God ,0 Indicates that no warning is provided inactive Time How many days after the password expires, disable this user When the failure between Password expiration date , With distance 1970 year 1 month 1 The number of days in a day means , The default is empty. , Indicates permanently available sign Keep unused ,
For future development Each line by 7 Fields make up , Use... Between fields “:” Separate , The format is as follows :
Account name : password :UID:GID: The personal data : Home directory :Shell Field description :
Account name : The user login Linux The name of the system .
password : Previously, the location of the password was saved in an encrypted format , Now the password is saved in /etc/shadow In file , This is just a password placeholder “x” or “*”. if “x”, It means that the password has passed shadow The protection of the
UID: User's identity , It's a number , Use it to distinguish different users
GID: Identification of the basic group in which the user belongs , It's a number , Use it to distinguish different groups , The same group has the same GID.
The personal data : You can record the full name of the user 、 Address 、 Office phone 、 Personal information such as home phone .
Home directory : similar Windows Personal directory , Usually /home/username, here username Is the user name , User execution “cd~” Command, the current directory will switch to the personal home directory .
Shell: Define the number of users to activate after logging in Shell, The default is Bash Shell
linux What is the file in which the group information is stored ? And what do the fields mean ?
User group account file ——/etc/group Every file in the system has a user and a group owner .
Use “ls –l” The command can see the owner and group of each file .
Each group in the system , stay /etc/group There is a line in the file Any user can read the user group account information profile . The real password of the user group is saved in /etc/gshadow In profile .

边栏推荐
- 基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 1
- Use the data to tell you where is the most difficult province for the college entrance examination!
- Hands on deep learning (38) -- realize RNN from scratch
- On Multus CNI
- xxl-job惊艳的设计,怎能叫人不爱
- Golang 类型比较
- Differences among opencv versions
- leetcode1229. Schedule the meeting
- [FAQ] summary of common causes and solutions of Huawei account service error 907135701
- 【Day1】 deep-learning-basics
猜你喜欢

xxl-job惊艳的设计,怎能叫人不爱

Hands on deep learning (46) -- attention mechanism

基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 1

Basic principle of servlet and application of common API methods

For programmers, if it hurts the most...

uniapp 小于1000 按原数字显示 超过1000 数字换算成10w+ 1.3k+ 显示

Hands on deep learning (45) -- bundle search
![[200 opencv routines] 218 Multi line italic text watermark](/img/3e/537476405f02f0ebd6496067e81af1.png)
[200 opencv routines] 218 Multi line italic text watermark

Debug:==42==ERROR: AddressSanitizer: heap-buffer-overflow on address

Hands on deep learning (III) -- Torch Operation (sorting out documents in detail)
随机推荐
2021-08-10 character pointer
Doris / Clickhouse / Hudi, a phased summary in June
Exercise 8-10 output student grades (20 points)
Golang type comparison
Vs201 solution to failure to open source file HPP (or link library file)
品牌连锁店5G/4G无线组网方案
Hands on deep learning (41) -- Deep recurrent neural network (deep RNN)
Exercise 9-3 plane vector addition (15 points)
Hands on deep learning (34) -- sequence model
A little feeling
How can people not love the amazing design of XXL job
Realsense d435 d435i d415 depth camera obtains RGB map, left and right infrared camera map, depth map and IMU data under ROS
Press the button wizard to learn how to fight monsters - identify the map, run the map, enter the gang and identify NPC
El Table Radio select and hide the select all box
Summary of small program performance optimization practice
什么是 DevSecOps?2022 年的定义、流程、框架和最佳实践
按键精灵跑商学习-商品数量、价格提醒、判断背包
Servlet基本原理与常见API方法的应用
对于程序员来说,伤害力度最大的话。。。
Latex insert picture, insert formula