Tag: openssh

在高山docker集装箱运行OpenSSH

我已经安装了OpenSSH ,现在我希望按照文档中所述运行/etc/init.d/sshd start 。 但是它不启动: / # /etc/init.d/sshd start /bin/ash: /etc/init.d/sshd: not found 思考? PS / # ls -la /etc/init.d/sshd -rwxr-xr-x 1 root root 2622 Jan 14 20:48 /etc/init.d/sshd /etc/init.d/sshd的内容: #!/sbin/openrc-run # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6.4,v 1.5 2015/05/04 02:56:25 vapier […]

Rsync不能在基于rhel7.3的openshift容器之间工作

我需要将文件从一个容器传输到其他容器。我开发了基于rhel7.3的docker镜像,并部署在openshift redhat 我们已经使用rsync来在容器之间传输文件。下面的rsync脚本工作正常,当我开发了基于Ubuntu的图像,但不是在红帽 #!/bin/bash mkdir ~/.ssh cd ~/.ssh ssh-keygen -f gatewayworker.rsa -t rsa -N '' sshpass -p "rsyncuser" ssh-copy-id -o "StrictHostKeyChecking no" -i ~/.ssh/gatewayworker.rsa.pub rsyncuser@gateway-manager while true do rsync -rtvu -e 'ssh -i gatewayworker.rsa -o StrictHostKeyChecking=no' rsyncuser@gateway-manager:/mnt/wso2am-2.1.0/repository/deployment/server/synapse-configs/ /mnt/wso2am-2.1.0/repository/deployment/server/synapse-configs/ –delete sleep 10 done 当试图find根连接之间的SSH连接无法build立连接时,我运行了命令ssh wso2user@gatewaymanager -p 22 -v 。 这是告诉连接build立,但在SSH2_MSG_KEXINIT sent步骤,我们正在Read from socket failed:Connection reset by […]

sshd AuthorizedKeysCommand引发状态127

我正在尝试构build一个ssh服务来允许push / pull到phabricator回购。 我dockerized所有的服务,我目前遇到了一个奇怪的错误,无法执行必要的身份validation脚本的SSH。 docker镜像运行php-fpm和sshd服务,把ssh和必要的php脚本联合起来。 特别是,我有以下/ etc / ssh / sshd_config: AuthorizedKeysCommand /usr/libexec/phabricator-ssh-hook.sh AuthorizedKeysCommandUser git AllowUsers git Port 2222 Protocol 2 PermitRootLogin no AllowAgentForwarding no AllowTcpForwarding no PrintMotd no #PrintLastLog no PasswordAuthentication no ChallengeResponseAuthentication no AuthorizedKeysFile none PidFile /var/run/sshd-phabricator.pid (作为一个方面,PrintLastLog抛出一个错误,当我启动sshd,我不认为是相关的,但可能是??) 当我手动运行 su – git -c "/srv/phabricator/scripts/ssh/ssh-auth.php git" ,我能够成功执行脚本。 但是,当我在debugging模式( /usr/sbin/sshd -d -d -d )下运行时检查sshd日志时,出现以下错误: …other […]

从Docker返回ssh隧道

我试图设置回到我的服务器的SSH隧道(为了有权访问我的客户端设备没有白色的IPv4)。 然后,我想能够从服务器连接到我的客户端设备。 问题是,我不能使它在捆绑Server + HostMachine + Docker中工作。 我到目前为止所做的: 当我从主机创buildback-ssh-tunnel时,我可以build立从服务器到主机的连接。 没问题。 我用: ssh -f -T -N -o StrictHostKeyChecking=no \ -R *:"$port":localhost:"$portClient" "$usernameServer"@"$server" 但是,当我从Docker Container运行此脚本时,没有结果。 我上了服务器 ssh: connect to host localhost port 43500: Connection refused 我没有忘记暴露端口23(我在该端口上使用ssh),并在docker-compose设置中绑定23:23。 我试图用这个线程来设置sshd服务。 https://docs.docker.com/engine/examples/running_ssh_service/ 我只能从内部networking连接,但不能从服务器连接: ssh root@192.168.1.21 -p 23 [成功。 我收紧容器。] ssh hostuser@192.168.1.21 [成功。 我到达主机] PS我不确定是否需要在docker中运行的sshd能够通过反向SSH隧道连接。

Gogits不会开始作为docker集装箱

我已经安装Gogits作为docker集装箱。 它工作正常,但我不得不重新启动我的服务器,现在我的Gogs容器不启动。 当我运行命令 docker start -a gogs 我重复了这些错误: s6-supervise gogs: fatal: unable to mkfifodir event: Permission denied s6-supervise openssh: fatal: unable to mkfifodir event: Permission denied s6-supervise gogs: fatal: unable to mkfifodir event: Permission denied s6-supervise gogs: fatal: unable to mkfifodir event: Permission denied s6-supervise openssh: fatal: unable to mkfifodir event: Permission denied s6-supervise openssh: […]

如何在Alpine上的OpenSSH中debugging无法使用的无密码RSA证书?

我计划使用真正的SSH客户端和SSH服务器编写和运行一些集成testing。 因为这需要服务器级的configuration,所以我在Docker中设置了testing,这样服务器就可以按照正确的规范构build,OpenSSH服务器启动,testing运行。 我的系统的一部分需要一个非root用户(称为nonpriv )能够ssh密码的基础上的服务器。 我已经生成了服务器证书和非root用户证书。 我已经build立了localhost作为一个已知的主机(所以服务器的真实性已经确认),但我很努力设置证书作为授权密钥。 我希望能够做ssh localhost作为nonpriv用户,并自动获得一个shell。 但是它跳过密钥,并进入密码authentication,这是不是我想要的。 Docker的ENTRYPOINT是这样的,所以每次运行的服务器密钥都是不同的: #!/bin/sh # # With thanks to https://github.com/danielguerra69/alpine-sshd if [ ! -f "/etc/ssh/ssh_host_rsa_key" ]; then # generate fresh rsa key ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa fi if [ ! -f "/etc/ssh/ssh_host_dsa_key" ]; then # generate fresh dsa key ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t […]

SSH服务器不接受连接

我使用Docker在本地构build了一个Docker镜像,它运行一个SSH服务器+一些其他服务。 Dockerfile是内部的,所以我不能在这里发布。 但我所做的基本事情是: RUN apt-get install -q -y openssh-server openssh-client RUN cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults RUN chmod aw /etc/ssh/sshd_config.factory-defaults RUN mkdir /var/run/sshd RUN echo 'root:changeme' |chpasswd ADD ./bootstrap.sh /root/bootstrap.sh ENTRYPOINT ["sh", "/root/bootstrap.sh"] 在bootstrap.sh里面: … echo "Starting SSH service…" /usr/sbin/sshd -D > /dev/null 2>&1 & ps -A | grep sshd … …迄今为止工作。 我可以从主机连接到SSH服务器(在Ubuntu容器内部运行)。 到现在为止还挺好。 现在我已经把图片上传到Dockerhub,我在tutum.co上运行它。 现在的问题是:SSH服务器启动,但我无法连接到它。 即使在本地的容器内。 […]

Docker容器中的OpenSSH服务器不工作

我有一个情况,我需要从同一核心操作系统启动两个docker集装箱。 Docker容器都必须运行一个ssh服务器。 我运行这些容器时暴露了不同的端口。 例如,容器1,9998:22将公开9998和容器2,9999:22将公开9999。 我使用以下命令为这两个容器中的root用户设置密码(使用dockerfile), 运行echo'root:test'| chpasswd。 当我SSH根@ IP -p 9998和使用testing作为密码能够进入该docker集装箱。 但是,当我ssh root @ IP -p 9999和使用相同的密码我不能。 我被拒绝的权限 。 任何线索?

Docker SSH服务器连接被拒绝

我有我的容器下面的Dockerfile: FROM ubuntu:latest RUN apt-get upgrade RUN apt-get update RUN apt-get -y install openssh-server CMD tail -f /dev/null 但是,当我build立和运行它时,它说连接被拒绝。 我尝试了几乎所有我能find的解决scheme,包括“ufw allow”,这不能正常工作,因为它告诉我需要成为根(我怎么能为Dockerfile做这件事?)。 我需要以这种方式访问​​容器: ssh <someUsername?>@containerIP PS:我知道有其他的方式来连接到一个Docker容器,但我需要使用SSH,所以附加等是不是一个选项。 编辑:这似乎是因为sshd没有运行,因为它不显示,如果我运行“ps -A”。

docker,如何从命令行主机远程SSH到docker集装箱?

我已经按照pipe道工程的步骤将容器分配的IP地址与pipe道DHCP分配到此处的泊坞柜中 我已经得到正确的IP地址根据本地局域网网段,我设置默认网关到我的容器与pipe道默认网关docker容器在这里 在dockerfile中configurationIP地址之前已经设置好了 RUN sudo apt-get -y install openssh-server 但我不能远程SSH容器,为什么这个问题? 请帮我完成我的任务