咔叽游戏

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 749|回复: 2

[Linux] 在CentOS7中安装和配置ssh

[复制链接]
  • TA的每日心情
    无聊
    2019-4-21 13:02
  • 签到天数: 3 天

    [LV.2]圆转纯熟

    发表于 2022-1-10 16:23:08 | 显示全部楼层 |阅读模式
    1. 安装openssh-server
    1. yum install -y openssl openssh-server
    复制代码
    2. 修改配置文件

    用vim打开配置文件/etc/ssh/sshd_config
    在CentOS7中安装和配置ssh-1.jpg

    将上图的PermitRootLogin,RSAAuthentication,PubkeyAuthentication的设置打开。
    启动ssh的服务:
    1. systemctl start sshd.service
    复制代码
    设置开机自动启动ssh服务
    1. systemctl enable sshd.service
    复制代码
    设置文件夹~/.ssh的访问权限:
    1. $ cd ~
    2. $ chmod 700 .ssh                                                                                                
    3. $ chmod 600 .ssh/*                                                                                             
    4. $ ls -la .ssh                                                                                                   
    5. total 16
    6. drwx------. 2 root root   58 May 15 00:23 .
    7. dr-xr-x---. 8 root root 4096 May 15 00:26 ..
    8. -rw-------. 1 root root  403 May 15 00:22 authorized_keys
    9. -rw-------. 1 root root 1766 May 15 00:21 id_rsa
    10. -rw-------. 1 root root  403 May 15 00:21 id_rsa.pub
    复制代码
    authorized_keys文件存储的是客户端的公共密钥。
    以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持咔叽论坛。

    原文地址:https://www.jb51.net/article/232569.htm
  • TA的每日心情
    开心
    2022-9-24 02:33
  • 签到天数: 4 天

    [LV.2]圆转纯熟

    发表于 2022-9-21 22:05:21 | 显示全部楼层
    2222222222222222222
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2023-1-11 18:40
  • 签到天数: 1 天

    [LV.1]登堂入室

    发表于 2023-1-11 19:36:15 | 显示全部楼层
    啥也不说了,楼主就是给力! www.2nzz.com
    回复 支持 反对

    使用道具 举报

    QQ|免责声明|小黑屋|手机版|Archiver|咔叽游戏

    GMT+8, 2024-3-29 16:40

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表