赵走x博客
网站访问量:151574
首页
书籍
软件
工具
古诗词
搜索
登录
2、阿里云,华为云配置后,ssh连接后较长时间操作后,自动断开
1、CentOS 7安装和配置ssh
1、CentOS 7安装和配置ssh
资源编号:76639
SSH
linux
热度:90
# 1. 安装openssh-server yum install -y openssl openssh-server # 2. 修改配置文件 用vim打开配置文件/etc/ssh/sshd_config ``` vi /etc/ssh/sshd_config ```  将上图的PermitRootLogin,RSAAuthentication,PubkeyAuthentication的设置打开。 # 3、启动ssh的服务: ``` systemctl start sshd.service ``` 设置开机自动启动ssh服务 ``` systemctl enable sshd.service ``` 设置文件夹~/.ssh的访问权限: ``` $ cd ~ $ chmod 700 .ssh $ chmod 600 .ssh/* $ ls -la .ssh total 16 drwx------. 2 root root 58 May 15 00:23 . dr-xr-x---. 8 root root 4096 May 15 00:26 .. -rw-------. 1 root root 403 May 15 00:22 authorized_keys -rw-------. 1 root root 1766 May 15 00:21 id_rsa -rw-------. 1 root root 403 May 15 00:21 id_rsa.pub ``` authorized_keys文件存储的是客户端的公共密钥。