当前位置:网站首页>RHCE command practice (II)
RHCE command practice (II)
2022-07-29 01:23:00 【Secular nostalgia】
RHCE Command practice ( Two )
One . Realization ssh Password free login
1、 start-up ssh service
[[email protected] ~]# systemctl start sshd
[[email protected] ~]# systemctl status sshd
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset>
Active: active (running) since Thu 2022-07-28 15:22:28 CST; 35s ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 1188 (sshd)
Tasks: 1 (limit: 11088)
Memory: 4.6M
CGroup: /system.slice/sshd.service
└─1188 /usr/sbin/sshd -D -oCiphers=[email protected],chacha20-p>
2、 Generate a pair of private keys and public keys
[[email protected] ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:/gUnxEXtSQY+WJUMqM8XmC8+wBvIkQfzeWYsGaGJy6I [email protected]
The key's randomart image is: +---[RSA 3072]----+ | .. o**.. | | .oo...= * | | . o= *+oo+ . | | . .o B.B ..o | | . o. =SBo... | | . . o.+ ++o | |E .= o. | | ..o. | | .. | +----[SHA256]-----+ 3、 Write the public key to root Under the authorized_keys In file [[email protected] ~]# ssh-copy-id [email protected] /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" The authenticity of host '192.168.106.129 (192.168.106.129)' can't be established.
ECDSA key fingerprint is SHA256:+EJ5oyw9iIfQF06zX1SBOdrhG5mQ317N5DL7ZXfTmeM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: y^H
Please type 'yes', 'no' or the fingerprint: y
Please type 'yes', 'no' or the fingerprint: yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
4、 stay client Sign in server host ( No password required )
[[email protected] ~]# ssh 192.168.106.129
Activate the web console with: systemctl enable --now cockpit.socket
This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To register this system, run: insights-client --register
Last login: Thu Jul 28 15:22:34 2022 from 192.168.106.1
Two .ssh Settings only allow student1, student2 The user login
1、 establish student1、student2 user
[[email protected] ~]# useradd student1 -p 123456
[[email protected] ~]# useradd student2 -p 123456
2、 Modify the configuration file /etc/ssh/sshd_config
......
[[email protected] ssh]# vim sshd_config
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
AllowUsers student1 student2
3、 restart sshd service
[[email protected] ssh]# systemctl restart sshd
3、 ... and .http Request method get and post The difference between
1, Request data is stored in different locations .GET Method request data exists in URL in ,POST Method request data exists in BODY In the main body , therefore GET Method has no request body
2, Different security . Because where the data is stored ,POST comparison GET More secure , The main reason is the storage location of the requested data ,GET stay URL in ,POST stay BODY in .
3, The requested data size is different . Also because URL The limitation of ,GET The requested data has a size limit ( It's usually 2-4K),POST The requested data is based on php.ini Configuration file , There are no restrictions .
4, Different scenarios . Because of the characteristics of the two request methods ,GET Requests are usually used in data insensitive scenarios ,POST It is usually used in login , register , Leaving a message. , In data sensitive scenarios such as information modification and submission .
Four .HTTP Status code , What are the commonly used status codes ?
100: This status code tells the client that it should continue to send requests , This temporary response is used to notify the client , Some requests have been accepted by the server , However, the client should continue to send the rest of the request , If the request has been completed , Just ignore the response , And the server will send a final result to the client after the request is completed
200: This is the most common http Status code , Indicates that the server has successfully accepted the request , And will return the final result requested by the client
202: Indicates that the server has accepted the request , But it hasn't been dealt with yet , And whether the request will eventually be processed is uncertain
204: The server successfully processed the request , But no entity content is returned , New header meta information may be returned
301: The web page requested by the client has been permanently moved to a new location , When the link changes , return 301 The code tells the client that the link changes , The client saves the new link , And send a request to the new link , Request result returned
404: request was aborted , The resource requested by the client is not found or does not exist
500: The server encountered an unknown error , The client's current request cannot be completed .
503: Server due to temporary server overload or maintenance , Unable to resolve the current request
5、 ... and .HTTP Request message and response message
Request message
GET / HTTP/1.1 Request line
Host: hackr.jp
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Acceptt-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache Various header fields
Blank line (CR + LF)
Request line : Requested method + request URI + HTTP edition ( The blank space to separate )
Header field : Various headers containing various conditions and properties representing requests and responses .
Generally speaking, there are 4 Species head , Namely : The first part of ge 、 Ask for the first 、 Response head and entity head .
response message
HTTP/1.1 200 OK Status line
Date: Fri, 13 Jul 2012 02:45:25 GMT
Server: Apache
Last-Modified: Fri, 31 Aug 2007 02:02:20 GMT
ETag: "45bael-16a-46d776ac"
Accept-Ranges: bytes
Content-Length: 362
Connection: close
Content-Type: text/html Various header fields
Blank line (CR + LF)
HTML Content (PS: MD Can't reasonably show ) Message body
Status line :HTTP edition + Status name + In response to the results ( The blank space to separate )
Header field : Various headers containing various conditions and properties representing requests and responses .
Generally speaking, there are 4 Species head , Namely : The first part of ge 、 Ask for the first 、 Response head and entity head .
6、 ... and .HTTP How to keep connected
Through session tracking technology : Pass an identifier back and forth between the browser and the server , This is called conversation (session) track . All from the browser contain the same identifier ( Here is SESSIONID) All requests belong to the same session .
The session is valid until it is explicitly terminated , Or when the user does not act for a period of time , Automatically set by the server to expire .
At present, there is no way to notify the server that the user has closed the browser , Because there is no permanent connection between the browser and the server , And the browser does not send information to the server when it is closed .
meanwhile , Closing the browser usually means a session ID The loss of ,COOKIE Will expire , Or injected with information URL Will no longer be able to use .
So when the user opens the browser again , The server cannot associate the new request with the previous session , You can only create a new session .
However , All data related to the previous session still exists on the server , Until the session expires and is cleared .
边栏推荐
- Hilbert 变换与瞬时频率
- 进程和线程知识点总结 2
- uniapp movable-view表格缩放过程想保持容器高度不变的解决办法
- 对接支付宝支付
- [Commons lang3 topic] 002 randomutils topic
- Y80. Chapter 4 Prometheus big factory monitoring system and practice -- Kube state metrics component introduction and monitoring extension (XI)
- 图扑软件亮相 2022 福州数博会,携手共创数字新时代
- 递归与分治
- Return the member function of *this
- Flink Postgres CDC
猜你喜欢

How to create a custom 404 error page in WordPress

递归与分治

Expression evaluation

进程和线程知识点总结1

Connect with Alipay payment

Classification prediction | MATLAB realizes time series classification prediction of TCN time convolution neural network

How to deal with the time, scope and cost constraints in the project?

Introduction to FLV documents
![[Jenkins' notes] introduction, free space; Continuous integration of enterprise wechat; Allure reports, continuous integration of email notifications; Build scheduled tasks](/img/0f/f75603616bd54039f8ccfa3e024768.png)
[Jenkins' notes] introduction, free space; Continuous integration of enterprise wechat; Allure reports, continuous integration of email notifications; Build scheduled tasks

Flask reports an error: pymysq1.err OperationalError:(1054, “Unknown column ‘None‘ in ‘field list‘“)
随机推荐
Machine learning | matlab implementation of RBF radial basis function neural network Newrbe parameter setting
进程和线程知识点总结 2
(完美解决)为什么在train/val/test数据集上用train模式效果都很好,但是在eval模式下全部很差
[MySQL] historical cumulative de duplication of multiple indicators
Oozie工作调度
Cookies and sessions
LeTax记录\documentclass{},authoryear属性使用
Common functions and usage of numpy
[Commons lang3 topic] 002 randomutils topic
JS judge whether array / object array 1 contains array / object array 2
[Commons lang3 topic] 004- numberutils topic
Brushless DC motor controller (how much is the hall charge for changing the motor)
20220728 sorting strings that are not pure numbers
Classification prediction | MATLAB realizes time series classification prediction of TCN time convolution neural network
Naver three party login
Synchronized keyword details
mysql 创建索引的三种方式
C语言300行代码实现扫雷(可展开+可标记+可更改困难级别)
教你一文解决 js 数字精度丢失问题
ActiveMQ basic details