sshd

redhat7 升级openssh

痴心易碎 提交于 2019-12-05 16:36:08
部署telnet,防止ssh启动失败 1、关闭防火墙或者开放23端口 2、安装启动服务,并开启root访问 yum install -y telnet-server.x86_64 yum install -y telnet.x86_64 yum install -y xinetd.x86_64 systemctl enable xinetd.service systemctl enable telnet.socket systemctl start telnet.socket systemctl start xinetd mv /etc/securetty /etc/securetty.bak 部署open-ssh #备份与卸载 mkdir /etc/ssh_oldbak/ mv /etc/ssh/* /etc/ssh_oldbak/ rpm -e `rpm -qa |grep openssh` #安装依赖 yum install -y gcc gcc-c++ glibc make autoconf openssl openssl-devel pcre-devel pam-devel yum install -y pam* zlib*#编译安装 cd openssh-7.9p1/ ./configure -prefix=/usr -sysconfdir=/etc/ssh -with

git clone without asking for users password

隐身守侯 提交于 2019-12-05 14:31:01
I want to create public git repository on my dedicated server for anyone to clone but it keeps asking me for password for git user. I have created user named git without password. Used: passwd -d git Unfortunately every time I try to do: git clone git@myhost:myrepo.git I'm getting asked for password. I have tried setting in sshd_config Match user git PermitEmptyPasswords yes PasswordAuthentication yes With either yes and no for PasswordAuthentication but still no use. It seems doing it over ssh is impossible. It will always ask for password unless you copy your public key. The solution is to

chkconfig原理

本秂侑毒 提交于 2019-12-05 09:41:48
chkconfig命令 功能:检查、设定系统的各种服务 updates and queries runlevel information for system services Linux提供了chkconfig命令用来更新和查询不同运行级上的系统服务。 语法: chkconfig [--list] [--type type][name] chkconfig --add name chkconfig --del name chkconfig --override name chkconfig [--level levels] [--type type] name <on|off|reset|resetpriorities> chkconfig [--level levels] [--type type] name 参数说明: --add 新增系统服务 --del 删除系统服务 --level 指定系统服务要在哪个执行等级中开启或关闭 --list 列出当前可从chkconfig指令管理的所有系统服务和等级代号 on/off/reset 在指定的执行登记,开启/关闭/重置该系统服务 运行级别: 具体内容查看/etc/inittab 0:关机(请不要切换到此等级) 1:单用户文本模式 2:多用户文本模式,不具有网络档案系统(NFS)功能 3:多用户文本模式,具有网络档案系统(NFS

“no matching host key type found” - Apache MINA SFTP server

雨燕双飞 提交于 2019-12-05 00:28:57
问题 I’m hoping to set up a SFTP server in Java using Apache MINA. It seems to start OK, but when I try to connect to it with an OpenSSH client, I get: $ ssh localhost -p 2222 Unable to negotiate with ::1: no matching host key type found. Their offer: ssh-dss $ ssh -V OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015 The Java app logs: ! java.lang.IllegalStateException: Unable to negotiate key exchange for server host key algorithms (client: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert

阿里云=>RHSA-2019:1884-中危: libssh2 安全更新

只愿长相守 提交于 2019-12-04 18:40:48
由于项目构建时间比较长,近期安全检查发现openssh有漏洞。所以要升级openssh到7.9p1版本。由于ssh用于远程连接,所以要谨慎操作。 建议生成环境要先做测试,之后再在生产环境升级。 1 前期准备 1.1 依赖安装 1、 OpenSSL版本:目前OpenSSH7.9不支持OpenSSH1.1.x以上。否则编译的时候会报错。 2、 Zlib1.1.4或1.2.1.2或更高版本 3、 gcc:因为编译需要gcc 4、 openssl-devel:编译时需要 1.2 注意事项 1、 前期多打开一个xshell窗口。保证连接正常。因为可能出现升级失败。结束后要确定好再关闭。 2、 备份sshd_config配置文件(方便后期使用或者方便升级失败使用) 3、 最好关闭防火墙,如不关闭防火墙请开启ssh需要的端口和telnet需要的端口。如果ssh不是22端口最好打开22端口。因为ssh配置文件默认22端口。所以建议关闭防火墙。 2、升级之后要重建xshell的session不然会出项下面提示 1 安装telnet 1.1 安装telnet 为防止openssh升级失败。所以安装telnet。保证openssh升级失败也可以通过telnet连接服务器,进行恢复操作。并不用去机房。 #yum install -y telnet-server #yum install -y xinetd

SSH远程免密码的密钥登录服务(Linux,Linux)

心不动则不痛 提交于 2019-12-04 11:39:49
本次实验基于两台Linux虚拟机之间的实验,一台做服务器,一台做客户机,模拟免密码的密钥登录。 首先两台虚拟机需要可以ping通,用客户机访问服务器。 sshd服务主配置文件路径: /etc/ssh/sshd_config sshd服务端口:22 打开终端看看有没有下图的3个服务: 如果没有需要安装 用命令:yum install openssh* 查看sshd服务是否已经安装,开启并设置开机启动。 进入配置文件修改参数: vim /etc/ssh/sshd_config 服务器配置文件配好之后我们换到另一台虚拟机(客户端)生成密钥,中间一路回车即可, 将生成的密钥传送到远程服务器上,注意这里客户端一定要ping通服务器。 之后在客户机输入命令 ssh 192.168.2.100(服务器IP地址) 出现错误。 解决办法: https://www.jianshu.com/p/bdc9d76da3f1 但是也没有解决 这里建议恢复快照,因为之前做了一下本地物理机Xshell密钥登录此服务器的操作,可能配置文件有问题。 建议每次实验完做下一个实验都恢复一下快照。 之后重新来过就成功了,如下图。 关于ssh的简介和两种登录的使用方法: https://blog.csdn.net/li528405176/article/details/82810342

虚拟机下CentOS7开启SSH连接

眉间皱痕 提交于 2019-12-04 11:06:05
在虚拟机(Vmware Workstation)下,安装了CentOS7,现在想通过SSH工具连接虚拟机中的CentOS7 1、 首先,要确保CentOS7安装了 openssh-server ,在终端中输入 yum list installed | grep openssh-server 此处 显示已经安装了 openssh-server ,如果又没任何输出显示表示没有安装 openssh-server ,通过输入 yum install openssh-server 来进行 安装 openssh-server 2、 找到了 /etc/ssh/ 目录下的sshd服务配置文件 sshd_config ,用Vim编辑器打开 将文件中,关于监听端口、监听地址前的 # 号去除 然后开启允许远程登录 最后 ,开启使用用户名密码来作为连接验证 保存 文件,退出 3、 开启 sshd 服务,输入 sudo service sshd start 检查 sshd 服务是否已经开启,输入 ps -e | grep sshd 或者 输入 netstat -an | grep 22 检查 22 号端口是否开启监听 4、 在Vmware Workstation中,查看CentOS7的属性,发现网络连接方式是采用的 NAT 方式连接的 5 、 在Vmware Workstation中, 点击 编辑 =》

安装openssh-server报Depends: openssh-client (= 1:6.6p1-2ubuntu2.8)错误

耗尽温柔 提交于 2019-12-04 11:05:38
SFTP称作“安全的FTP”,它使用ssh文件传输协议。所以我们需要安装openssh-server ubuntu自带的有openssh-client,所以可以通过 ssh username@host 来远程连接linux。 可是要想通过ssh被连接,ubuntu系统需要有openssh-server,可以通过如下操作: 1、可是要想通过ssh被连接,ubuntu系统需要有openssh-server,可以通过 ps -e|grep ssh 来查看, 显示如下: 7153 ? 00:00:00 sshd 7222 ? 00:00:00 sshd 7262 ? 00:00:00 sshd 如果没有显示sshd则说明没有安装openssh-server。 2、可通过 sudo apt-get install openssh-server 安装openssh-server,如果顺利的话会安装成功,如果遇到以下问题: openssh-server : Depends: openssh-client (= 1:6.6p1-2ubuntu2.8) Recommends: ssh-import-id but it is not going to be installed E: Unable to correct problems, you have held broken packages.

Setting ssh public keys on Docker image

我与影子孤独终老i 提交于 2019-12-04 10:29:31
I setup a Docker image that supports ssh. No problem, lots of examples. However, most examples show setting a password using passwd. I want to distribute my image. Having a fixed password, especially to root, seems like a gaping security hole. Better, to me, is to setup the image with root having no password. When a user gets the image they would then copy their public ssh file to the image /root/.ssh/authorized_keys file. Is there a recommended way to do this? Provide a Dockerfile that builds on my image with an ADD command that user can edit? Provide a shell script that runs something like

Have sshd forward logins of git user to a (GitLab) Docker container

此生再无相见时 提交于 2019-12-04 09:38:08
问题 I would like to configure sshd on my host machine to forward public key logins of a certain user to a Docker container that runs its own sshd service. To give some context, I have GitLab running in a Docker container and I dislike opening another port on the host machine for the SSH GitLab communication but instead have sshd on the host machine redirect user and key directly to the port the GitLab exposes on the local machine. My idea is to do something like this: Match User git ForceCommand