1.連接服務(wù)器
-
Ssh root@服務(wù)器地址
連接遠(yuǎn)程服務(wù)器 -
Uname -a
顯示服務(wù)器信息 -
log out
退出服務(wù)器
2.web服務(wù)器
- nginx
- apache
- tomcat php
2.1 安裝nginx
yum install nginx
2.2 配置服務(wù)器
user nginx -> user root
http server location
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
vim /etc/nginx/nginx.conf
image.png
image.png
:set nu
vim模式下出現(xiàn)行號
3. 上傳服務(wù)到服務(wù)器
使用scp命令scp -r ./* root@ip:/root/www
服務(wù)器端和本地都要有scpyum install openssh-cli
ps -ef | grep nginx
查看一下當(dāng)前再跑的進(jìn)程
image.png
nginx -c /etc/nginx/nginx.conf
如果下面那句話報錯nginx -s stop
把nginx停止nginx
運行nginx
3.出問題了
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:NHg/pDwRdtQThZzY3Z4Uwq/Rz93FgmL3UdBAFleWFWk.
Please contact your system administrator.
Add correct host key in /Users/yuanting/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/yuanting/.ssh/known_hosts:102
ECDSA host key for 192.168.198.190 has changed and you have requested strict checking.
Host key verification failed.
因為服務(wù)器的ip發(fā)生變更了
第一次SSH連接時细燎,會生成一個認(rèn)證,儲存在客戶端(也就是用SSH連線其他電腦的那個,自己操作的那個)中的known_hosts倍踪,但是如果服務(wù)器驗證過了清焕,認(rèn)證資訊當(dāng)然也會更改矛紫,服務(wù)器端與客戶端不同時仁热,就會跳出錯誤啦耙厚。
解決辦法:刪除留存的秘鑰
輸入命令:ssh-keygen -R +輸入服務(wù)器的IP
例如:
~ ssh-keygen -R 192.168.198.147 ?
# Host 192.168.198.147 found: line 36
/Users/renwoxing/.ssh/known_hosts updated.
轉(zhuǎn):https://blog.csdn.net/qq_21127151/article/details/105237218