ssh 配置 主机信任认证
发表于:2025-02-04 作者:千家信息网编辑
千家信息网最后更新 2025年02月04日,sshd 的配置文件 /etc/ssh/sshd_config port 修改sshd的端口 AddressFamily any 支持的IP协议,any表示ipv4和ipv6 ListenAddres
千家信息网最后更新 2025年02月04日ssh 配置 主机信任认证sshd 的配置文件 /etc/ssh/sshd_config port 修改sshd的端口 AddressFamily any 支持的IP协议,any表示ipv4和ipv6 ListenAddress 0.0.0.0 指定监听的地址,0.0,0,0表示任意地址,也可以指定特定的地址 KeyRegenerationInterval 1h 密钥重新生成的间隔 ServerKeyBits 1024 服务器端的密钥长度 LoginGraceTime 2m 登陆的宽容期,(密码等待的时间) PermitRootLogin yes 是否允许root直接登陆 MaxAuthTries 6 密码尝试次数 RSAAuthentication yes 是否使用基于密钥的认证 PubkeyAuthentication yes 是否使用基于密钥的认证 AuthorizedKeysFile .ssh/authorized_keys 密钥存放路径 PasswordAuthentication yes 基于口令认证 UsePAM yes 是否使用pam认证 #Banner none 是否显示banner指定的文件内容,(打印欢迎信息) #PrintMotd yes 是否显示/etc/motd文件的内容 #PrintLastLog yes 是否显示上次登录的信息,一般不显示
白名单和黑名单:黑白名单同时出现,黑名单失效 /etc/hosts.allow /etc/hosts.deny
ssh ssh ip COMMAND 执行命令返回 ssh root@192.168.56.28 ifconfig -l 指定登录用户名 调用远程图形化命令 -X -Y
基于密钥的认证:(互信认证) ssh-keygen -t [rsa|dsa] 指定加密算法 -f /path 指定输出路径 -N 'password' 指定密码 1 生成一对密钥(公钥和私钥) 2 将公钥床送至服务器某用户的家目录下的.ssh/authorized_keys文件中(拥有谁的公钥,谁可以登陆当前主机)
[root@LinuxTest ~]# 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: 6b:e9:a2:39:af:0c:0d:e8:95:6f:ff:4a:fb:fc:17:34 root@LinuxTest The key's randomart image is: +--[ RSA 2048]----+ | | | | | | | . . E | |. .o S . . | |. .o. o . | | .. .o .+ . | | oo.+oo . | | ==.==+... | +-----------------+
[root@LinuxTest ~]# scp .ssh/id_rsa.pub root@192.168.56.89:/root/.ssh/authorized_keys 发送公钥到远程服务器 root@192.168.56.89's password: id_rsa.pub 100% 396 0.4KB/s 00:00 [root@LinuxTest ~]# ssh 192.168.56.89 Last login: Tue Dec 20 09:29:41 2016 from 192.168.56.28 [root@ray ~]#
sftp ssh协议类型的ftp [root@LinuxTest ~]# sftp 192.168.56.89 Connecting to 192.168.56.89...
白名单和黑名单:黑白名单同时出现,黑名单失效 /etc/hosts.allow /etc/hosts.deny
ssh ssh ip COMMAND 执行命令返回 ssh root@192.168.56.28 ifconfig -l 指定登录用户名 调用远程图形化命令 -X -Y
基于密钥的认证:(互信认证) ssh-keygen -t [rsa|dsa] 指定加密算法 -f /path 指定输出路径 -N 'password' 指定密码 1 生成一对密钥(公钥和私钥) 2 将公钥床送至服务器某用户的家目录下的.ssh/authorized_keys文件中(拥有谁的公钥,谁可以登陆当前主机)
[root@LinuxTest ~]# 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: 6b:e9:a2:39:af:0c:0d:e8:95:6f:ff:4a:fb:fc:17:34 root@LinuxTest The key's randomart image is: +--[ RSA 2048]----+ | | | | | | | . . E | |. .o S . . | |. .o. o . | | .. .o .+ . | | oo.+oo . | | ==.==+... | +-----------------+
[root@LinuxTest ~]# scp .ssh/id_rsa.pub root@192.168.56.89:/root/.ssh/authorized_keys 发送公钥到远程服务器 root@192.168.56.89's password: id_rsa.pub 100% 396 0.4KB/s 00:00 [root@LinuxTest ~]# ssh 192.168.56.89 Last login: Tue Dec 20 09:29:41 2016 from 192.168.56.28 [root@ray ~]#
sftp ssh协议类型的ftp [root@LinuxTest ~]# sftp 192.168.56.89 Connecting to 192.168.56.89...
密钥
认证
公钥
文件
地址
密码
服务器
服务
登陆
信息
内容
名单
命令
用户
路径
黑名单
黑名
生成
登录
主机
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
望远县软件开发定制贵吗
网络安全检测立项材料
软件开发需求文档示例
app违反网络安全
mc服务器管理
zibbix监控数据库连接
花雨庭服务器是不是迷你玩家
只能检索国外论文的数据库
迈高网络技术
dsp软件开发兼职
最新linux数据库用的是什么
中搜网络技术股份
软件开发完怎么交给客户
使用数据库模型有什么好处
开展网络安全进学校法治宣传活动
在校软件开发项目
阿里 数据库监控
中国警察网络安全
主机无法访问虚拟服务器
北京软件开发驻场公司有哪些
数据库创建索引少
中兴2021软件开发工资
网络安全法三十八条
临汾网络安全宣传周启动仪式
1994年后信息网络安全问题
网络安全的突出性
死亡搁浅啥时候有服务器
安全的win10服务器租用
网络安全八不准十严禁的内容
城市网络安全宣传