is:cos:centos服务搭建-03-开启ssh服务

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
is:cos:centos服务搭建-03-开启ssh服务 [2025/02/18 07:37] Aker J Luis:cos:centos服务搭建-03-开启ssh服务 [2025/02/18 07:43] (当前版本) Aker J Lu
行 1: 行 1:
 ==== Linux系统 ==== ==== Linux系统 ====
-SSH 是为建立在应用层基础上的安全协议。SSH 是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议。利用 SSH 协议可以有效防止远程管理过程中的信息泄露问题。如果没有开启ssh无法进行远程连接终端。 
  
-  * 查看是否开启了ssh服务是否安装,使用命令:sudo ps -e |grep ssh //如果安装了的是会有sshd服务的 +  * SSH 是为建立在应用层基础上的安全协议。 
-  * 先更新资源列表,使用命令:sudo apt-get update +  * SSH 是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议。 
-  * 安装openssh-server,使用命令:sudo apt-get install openssh-server+  * 利用 SSH 协议可以有效防止远程管理过程中的信息泄露问题。 
 +  * 如果没有开启ssh无法进行远程连接终端。 
 + 
 +  * 查看是否开启了ssh服务是否安装,使用命令:<code>sudo ps -e |grep ssh</code> 
 +  * 先更新资源列表,使用命令:<code>sudo apt-get update</code> 
 +  * 安装openssh-server,使用命令:<code>sudo apt-get install openssh-server</code>
   * 继续输入sudo ps -e |grep ssh查看是否安装成功。   * 继续输入sudo ps -e |grep ssh查看是否安装成功。
-  * 启动SSH服务:sudo /etc/init.d/ssh start+  * 启动SSH服务:<code>sudo /etc/init.d/ssh start</code>
  
   * 修改SSH配置文件。可以通过SSH配置文件更改包括端口、是否允许root登录等设置,配置文件位置:/etc/ssh/sshd_config   * 修改SSH配置文件。可以通过SSH配置文件更改包括端口、是否允许root登录等设置,配置文件位置:/etc/ssh/sshd_config
-  * 默认是不允许root远程登录的,可以再配置文件开启。sudo vim /etc/ssh/sshd_config+  * 默认是不允许root远程登录的,可以再配置文件开启。<code>sudo vim /etc/ssh/sshd_config</code>
    找到PermitRootLogin without-password 修改为PermitRootLogin yes    找到PermitRootLogin without-password 修改为PermitRootLogin yes
-  * 重启SSH服务:service sshd restart+  * 重启SSH服务:<code>service sshd restart</code>
  
   * 连接Ubuntu,出现错误:Failed SSH Key Exchange/提示key exchange failed.这是密匙交换错误,说明Ubuntu还没有打开密匙交换的配置。   * 连接Ubuntu,出现错误:Failed SSH Key Exchange/提示key exchange failed.这是密匙交换错误,说明Ubuntu还没有打开密匙交换的配置。
-    * 打开配置文件进行编辑:vim /etc/ssh/ssh_config+    * 打开配置文件进行编辑:<code>vim /etc/ssh/ssh_config</code>
     * 去掉前面的注释符,使用22端口。     * 去掉前面的注释符,使用22端口。
     * port 22     * port 22
行 20: 行 24:
     * Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc     * Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
     * MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160     * MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
-    * 使用vi /etc/ssh/sshd_config打开并修改服务器端的配置文件。+    * 使用<code>vi /etc/ssh/sshd_config</code>打开并修改服务器端的配置文件。
     * 在protocol 2 下面粘贴:     * 在protocol 2 下面粘贴:
     * Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc     * Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
     * MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160     * MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
-    * 然后重启sshd服务:service sshd restart+    * 然后重启sshd服务:<code>service sshd restart</code>
  
 ==== Centos7系统 ==== ==== Centos7系统 ====
  • is/cos/centos服务搭建-03-开启ssh服务.1739864274.txt.gz
  • 最后更改: 2025/02/18 07:37
  • Aker J Lu