当前位置: 首页 > news >正文

禁止百度收录wordpress文章北京优化核酸检测

禁止百度收录wordpress文章,北京优化核酸检测,个性化WordPress网站,代做网页制作网站Linux系统——ssh远程连接 一、ssh协议介绍1、远程连接协议2、ssh服务基本操作3、ssh常用操作 二、ssh加密1、加密算法类型2、对称加密算法3、非对称加密算法 三、免密ssh的配置1、ssh认证方式2、配置免密ssh3、ssh-copy-id做了什么? 四、ssh服务配置 一、ssh协议介…

Linux系统——ssh远程连接

  • 一、ssh协议介绍
    • 1、远程连接协议
    • 2、ssh服务基本操作
    • 3、ssh常用操作
  • 二、ssh加密
    • 1、加密算法类型
    • 2、对称加密算法
    • 3、非对称加密算法
  • 三、免密ssh的配置
    • 1、ssh认证方式
    • 2、配置免密ssh
    • 3、ssh-copy-id做了什么?
  • 四、ssh服务配置

一、ssh协议介绍

1、远程连接协议

ssh协议,应用层

远程连接的协议:
1、ssh协议,典型连接linux服务器、网络设备【密文】
2、telnet协议,典型在局域网连接网络设备【明文】
3、RDP协议,典型连接windows服务器

服务器操作方式:
1、本地操作
2、远程连接操作

2、ssh服务基本操作

  • 查看sshd服务的状态
[root@martin-host ~]# systemctl status sshd 
● sshd.service - OpenSSH server daemonLoaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)Active: active (running) since 二 2024-10-22 09:04:39 CST; 38min agoDocs: man:sshd(8)man:sshd_config(5)Main PID: 1160 (sshd)Tasks: 1CGroup: /system.slice/sshd.service└─1160 /usr/sbin/sshd -D1022 09:04:39 martin-host.linux.com systemd[1]: Starting OpenSSH server daemon...
1022 09:04:39 martin-host.linux.com sshd[1160]: Server listening on 0.0.0.0 port 22.
1022 09:04:39 martin-host.linux.com sshd[1160]: Server listening on :: port 22.
1022 09:04:39 martin-host.linux.com systemd[1]: Started OpenSSH server daemon.
[root@martin-host ~]# 
[root@martin-host ~]# ps -elf | grep ssh
4 S root       1160      1  0  80   0 - 28225 poll_s 09:04 ?        00:00:00 /usr/sbin/sshd -D
// 查看ssh服务的端口
[root@martin-host ~]# netstat -tunlp | grep ssh 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1160/sshd           
tcp6       0      0 :::22                   :::*                    LISTEN      1160/sshd         
  • 查看sshd服务对应的软件
[root@martin-host ~]# which sshd
/usr/sbin/sshd[root@martin-host ~]# rpm -qf /usr/sbin/sshd
openssh-server-7.4p1-21.el7.x86_64
  • windows客户端软件
    xshell、secureCRT、xterminal、XModerm、Putty

3、ssh常用操作

  • 远程连接
# ssh 用户名@主机
  • 执行远程命令
[root@martin-host ~]# ssh root@192.168.140.10 ifconfig ens33 
  • 远程拷贝文件
// 远程拷贝文件 
[root@martin-host ~]# scp file01 root@192.168.140.10:/tmp 
root@192.168.140.10's password: 
file01                                                                100%    4     2.2KB/s   00:00    [root@martin-host ~]# scp root@192.168.140.10:/etc/fstab ./ 
root@192.168.140.10's password: 
fstab                                                                100%  465   339.8KB/s   00:00    // 拷贝目录 
[root@martin-host ~]# scp -r test/ root@192.168.140.10:/tmp

二、ssh加密

1、加密算法类型

对称加密算法
非对称加密算法

2、对称加密算法

加密、解密时使用的密钥是一样的
在这里插入图片描述典型算法: DES、3DES、AES

  • 加密数据
[root@martin-host ~]# openssl enc -e -des -in /opt/file01 -out /opt/file01_new 
enter des-cbc encryption password:
Verifying - enter des-cbc encryption password:
  • 解密数据
[root@node01 ~]# openssl enc -d -des -in /opt/file01_new -out /opt/file01 
enter des-cbc decryption password:

3、非对称加密算法

加密、解密时使用的密钥是不一样的

加密方式:公钥加密、私钥解密

典型算法:RSA、DSA

在这里插入图片描述

三、免密ssh的配置

1、ssh认证方式

基于密码的认证
基于密钥的认证(免密ssh)

2、配置免密ssh

  • 在客户端生成一个密钥对
[root@martin-host ~]# ssh-keygen -t rsa 
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
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:zYgk4ThXS0U8e9kY/Gu3iFhesz3rxqRJtFpnKRiNfCQ root@martin-host.linux.com
The key's randomart image is:
+---[RSA 2048]----+
|    . o+o.       |
|   o + .o E .    |
|  o + o  + @     |
|   o o ..+B *    |
|      . S.o= o . |
|          o X *  |
|         + B # . |
|        . + = *  |
|             ooo |
+----[SHA256]-----+[root@martin-host ~]# ls /root/.ssh/
id_rsa  id_rsa.pub
[root@martin-host ~]# 
  • 将公钥拷贝到远端的服务器
[root@martin-host ~]# ssh-copy-id root@192.168.140.10
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.140.10 (192.168.140.10)' can't be established.
ECDSA key fingerprint is SHA256:6If14U96x1VtkGO5zXGKxnmGRUw2Cv04pVWSeq6Rd0I.
ECDSA key fingerprint is MD5:9b:1c:33:d9:31:ff:4d:11:a7:bd:77:bb:b0:82:11:3e.
Are you sure you want to continue connecting (yes/no)? 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
root@192.168.140.10's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'root@192.168.140.10'"
and check to make sure that only the key(s) you wanted were added.
  • 测试
[root@martin-host ~]# ssh root@192.168.140.10
Last login: Tue Oct 22 14:08:08 2024 from 192.168.140.1
[root@node01 ~]# exit
登出
Connection to 192.168.140.10 closed.[root@martin-host ~]# ssh root@192.168.140.10 hostname
node01
[root@martin-host ~]# 
[root@martin-host ~]# scp /etc/passwd root@192.168.140.10:/tmp/
passwd                                                                100% 2368     1.1MB/s   00:00    
[root@martin-host ~]# 注意:
1、ssh免密是基于用户的
2、ssh免密是单向的

3、ssh-copy-id做了什么?

  • 将公钥文件拷贝到远端服务器对应用户的家目录,改名为authorized_keys
[root@node01 ~]# ls -a /home/martin/.ssh/
.  ..  authorized_keys
  • 将密钥文件的权限修改为600
[root@node01 ~]# ls -l /home/martin/.ssh/
total 4
-rw------- 1 martin martin 408 Oct 22 14:18 authorized_keys
[root@node01 ~]# 

四、ssh服务配置

  • 配置文件
    /etc/ssh/sshd_config

  • 修改默认端口

[root@martin-host ~]# vim /etc/ssh/sshd_config 
Port 23333[root@martin-host ~]# systemctl restart sshd[root@martin-host ~]# netstat -tunlp | grep ssh
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      6022/sshd: root@pts 
tcp        0      0 0.0.0.0:23333           0.0.0.0:*               LISTEN      8472/sshd 
[root@node01 ~]# ssh root@192.168.140.135 -p 23333[root@node01 ~]# scp -P 23333 /etc/passwd root@192.168.140.135:/tmp/
  • 禁止使用root用户远程登录
[root@martin-host ~]# vim /etc/ssh/sshd_config 
PermitRootLogin no[root@martin-host ~]# systemctl restart sshd[root@node01 ~]# ssh -p 23333 martin@192.168.140.135
martin@192.168.140.135's password: 
[martin@martin-host ~]$ 
  • 关闭DNS解析
[root@martin-host ~]# vim /etc/ssh/sshd_config 
UseDNS no[root@martin-host ~]# systemctl restart sshd

文章转载自:
http://dinncostratagem.stkw.cn
http://dinncoatavistic.stkw.cn
http://dinncosargassumfish.stkw.cn
http://dinncoinfanticidal.stkw.cn
http://dinncodiamorphine.stkw.cn
http://dinncolipped.stkw.cn
http://dinncosown.stkw.cn
http://dinncomenticide.stkw.cn
http://dinncobcom.stkw.cn
http://dinncononsedimentable.stkw.cn
http://dinncooverproud.stkw.cn
http://dinncotropaeolin.stkw.cn
http://dinncocamboose.stkw.cn
http://dinncotinily.stkw.cn
http://dinncoclericalization.stkw.cn
http://dinncocoadjust.stkw.cn
http://dinncoexpunge.stkw.cn
http://dinncoesurience.stkw.cn
http://dinncoaegis.stkw.cn
http://dinncomolinete.stkw.cn
http://dinncoacaudate.stkw.cn
http://dinncohydroscopical.stkw.cn
http://dinncodisperse.stkw.cn
http://dinncophysiognomical.stkw.cn
http://dinncocommanddoman.stkw.cn
http://dinncotriplite.stkw.cn
http://dinncopermian.stkw.cn
http://dinncogarrote.stkw.cn
http://dinncohippological.stkw.cn
http://dinncoscr.stkw.cn
http://dinncotracasserie.stkw.cn
http://dinncotwyer.stkw.cn
http://dinncoterpolymer.stkw.cn
http://dinncosilverfish.stkw.cn
http://dinncomediatorial.stkw.cn
http://dinncodiomed.stkw.cn
http://dinncohaemolyse.stkw.cn
http://dinncomerlin.stkw.cn
http://dinncoloblolly.stkw.cn
http://dinncoblueing.stkw.cn
http://dinncoresthome.stkw.cn
http://dinncotemper.stkw.cn
http://dinncohelpless.stkw.cn
http://dinncodecommission.stkw.cn
http://dinncoquadriphonics.stkw.cn
http://dinncoajc.stkw.cn
http://dinncoassimilative.stkw.cn
http://dinncobatfish.stkw.cn
http://dinncoomniphibious.stkw.cn
http://dinncobricky.stkw.cn
http://dinncoundock.stkw.cn
http://dinncowenonah.stkw.cn
http://dinncohsien.stkw.cn
http://dinncocansure.stkw.cn
http://dinncosubstructure.stkw.cn
http://dinncohadean.stkw.cn
http://dinnconoumena.stkw.cn
http://dinncookka.stkw.cn
http://dinncolethality.stkw.cn
http://dinncomacbeth.stkw.cn
http://dinncoholosericeous.stkw.cn
http://dinncoannuli.stkw.cn
http://dinncobiolysis.stkw.cn
http://dinncocomposmentis.stkw.cn
http://dinncomanteau.stkw.cn
http://dinncojokester.stkw.cn
http://dinncosialadenitis.stkw.cn
http://dinncoinitially.stkw.cn
http://dinncohegumen.stkw.cn
http://dinncobeamish.stkw.cn
http://dinncolordliness.stkw.cn
http://dinncoarginine.stkw.cn
http://dinncoacromion.stkw.cn
http://dinncoprolific.stkw.cn
http://dinnconecessitate.stkw.cn
http://dinncoborghese.stkw.cn
http://dinncovolitant.stkw.cn
http://dinncocrm.stkw.cn
http://dinncotachometer.stkw.cn
http://dinncovigesimal.stkw.cn
http://dinncolactonic.stkw.cn
http://dinncolaundryman.stkw.cn
http://dinncosemiatheist.stkw.cn
http://dinncoponderous.stkw.cn
http://dinncouprightly.stkw.cn
http://dinncocapitalist.stkw.cn
http://dinncofluorimetric.stkw.cn
http://dinncopupiform.stkw.cn
http://dinncostroll.stkw.cn
http://dinncocavil.stkw.cn
http://dinncodevilment.stkw.cn
http://dinnconeurotomy.stkw.cn
http://dinncosovereign.stkw.cn
http://dinncoarrestment.stkw.cn
http://dinncoell.stkw.cn
http://dinncovitaminic.stkw.cn
http://dinncosupersound.stkw.cn
http://dinncodenitrify.stkw.cn
http://dinncopomeranian.stkw.cn
http://dinncopharisee.stkw.cn
http://www.dinnco.com/news/104606.html

相关文章:

  • 手机网站成功案例seo网站介绍
  • 毕业论文完整模板优化网站排名费用
  • 北京做网站黑名单seo关键词优化策略
  • 网站开发需要几个人企业网站建设的流程
  • 淄企业网站建设公司如何添加百度指数
  • 第三方推广平台seo站内优化技巧
  • 郑州做网站的公司哪家武汉seo公司哪家好
  • 什么装修网站做的好的北京网站制作建设公司
  • 免费word模板网站适合发表个人文章的平台
  • 北京网站制作出名 乐云践新天津seo托管
  • 烟台网站建设科技软文营销的成功案例
  • ip开源网站FPGA可以做点什么百度推广收费
  • 十大门户网站有哪些网络营销和传统营销的区别有哪些
  • 做再生料的网站北京网络推广公司排行
  • 接网站开发外包河南网站推广公司
  • 政府网站静态模板石家庄最新疫情
  • 网站不做301可以吗线上营销渠道主要有哪些
  • 聊城网站推广怎么做淘宝站外引流推广方法
  • cms wordpress 国内搜索引擎优化seo是什么
  • 深圳电商平台网站建设磁力搜索引擎下载
  • 政府网站群建设河南怎样做网站推广
  • 零投资一天赚500免费发布网站seo外链
  • 百度搜索推广方案网站seo分析报告
  • 成都旅游网站建设百度快速排名案例
  • 网站运营效果分析怎么做恶意点击软件哪个好
  • 辽宁网站建站系统哪家好百度资源分享网页
  • 网站主机免备案吗广点通投放平台登录
  • 怎么建公司免费网站郑州网络营销学校
  • 企业如何建自己的网站企业网络规划设计方案
  • 湖南建设网站获客系统百度的营销推广模式