2023-04-01 13:49阅读: 38评论: 0推荐: 0

SSH远程连接

一、更新Debian系统数据软件源

apt-get update

二、安装SSH服务

apt-get install -y ssh

安装完成ssh 服务默认是开启的,手动开启命令

/etc/init.d/ssh start

三、查看ssh服务状态

/etc/init.d/ssh status

四、备份 SSH 配置文件

cp /etc/ssh/sshd_config{,.bak}

编辑 SSH 配置文件

利用VIM 编辑配置文件,把以下代码对 /etc/ssh/sshd_config 文件内容进行替换

vim /etc/ssh/sshd_config

利用命令 more /etc/ssh/sshd_config |grep -v "^#" |grep -v "^$" 查看文件内容是否与下面一致,不一致则改成一致

Include /etc/ssh/sshd_config.d/*.conf
Port 22
PermitRootLogin yes
PasswordAuthentication yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server

重启 SSH 服务

/etc/init.d/ssh restart

本文作者:Byron_Zora

本文链接:https://www.cnblogs.com/byzora/p/17278521.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Byron_Zora  阅读(38)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.