- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试构建一个ssh服务以允许推/拉到phabricator仓库。我已经对所有服务进行了docker化,并且当前遇到了一个奇怪的错误,该错误无法执行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
su - git -c "/srv/phabricator/scripts/ssh/ssh-auth.php git"
,我能够成功执行脚本。
sshd
)运行时检查
/usr/sbin/sshd -d -d -d
日志时,收到以下错误:
...other stuff...
debug3: monitor_read: checking request 22
debug3: mm_answer_keyallowed entering
debug3: mm_answer_keyallowed: key_from_blob: 0x5564c1f473c0
debug3: subprocess: AuthorizedKeysCommand command "/usr/libexec/phabricator-ssh-hook.sh git" running as git
debug1: temporarily_use_uid: 1000/1000 (e=0/0)
debug1: restore_uid: 0/0
debug3: subprocess: AuthorizedKeysCommand pid 885
debug1: temporarily_use_uid: 1000/1000 (e=0/0)
debug2: key not found
AuthorizedKeysCommand /usr/libexec/phabricator-ssh-hook.sh git failed, status 127
debug1: restore_uid: 0/0
Failed publickey for git from some.ip.address.here port 58378 ssh2: ED25519 SHA256:GBGS4ag9s8msV3XsuojlIoqATF63tvXU3t5GIUN0eYY
debug3: mm_answer_keyallowed: key 0x5564c1f473c0 is not allowed
debug3: mm_request_send entering: type 23
debug2: userauth_pubkey: authenticated 0 pkalg ssh-ed25519 [preauth]
debug3: userauth_finish: failure partial=0 next methods="publickey" [preauth]
debug3: send packet: type 51 [preauth]
Connection closed by 24.5.151.66 port 58378 [preauth]
debug1: do_cleanup [preauth]
debug1: monitor_read_log: child log fd closed
debug3: mm_request_receive entering
debug1: do_cleanup
debug1: Killing privsep child 884
EDIT: It seems like
/usr/libexec/phabricator-ssh-hook.sh
actually does execute, but the script it executes/srv/phabricator/bin/ssh-auth
, presumably fails. That file (the phabricator directory) is actually on a host volume. I wonder if that could be the cause of thesestatus 127
issues.
git
用户执行。
Linux version 4.11.9-1-ARCH (builduser@tobias) (gcc version 7.1.1 20170621 (GCC) ) #1 SMP PREEMPT Wed Jul 5 18:23:08 CEST 2017
Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 3dfb8343
Built: Wed Jul 26 18:03:33 2017
OS/Arch: linux/amd64
Server:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 02c1d87617
Built: Wed Jul 26 20:03:39 2017
OS/Arch: linux/amd64
Experimental: false
Containers: 10
Running: 10
Paused: 0
Stopped: 0
Images: 147
Server Version: 17.06.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfb82a876ecc11b5ca0977d1733adbe58599088a
runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.11.9-1-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.631GiB
Name: <host-name>
ID: KYNR:4YHS:T4C2:URUY:GIB5:KCNF:DCNC:JLUT:DYO3:D5P7:VVOD:C2YV
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
最佳答案
我也为此而苦苦挣扎。最终,我发现执行php
时PATH
中没有phabricator-ssh-hook.sh
。就我而言,它安装在/usr/local/bin
(默认为FreeBSD)中,因此我添加了:
export PATH="/usr/local/bin:$PATH"
phabricator-ssh-hook.sh
的最后一行之前。
关于docker - sshd AuthorizedKeysCommand抛出状态127,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45808340/
从我在 Linux 上的测试来看,似乎是 服务 sshd 重新加载 仅在 sshd 已运行时有效 如果 sshd_config 文件有问题,则停止 sshd 即使 sshd_config 文件有问题也
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwa
sshd 限制登陆的几种方法总结 1. 在 /etc/hosts.allow 写: ?
我正在尝试构建一个ssh服务以允许推/拉到phabricator仓库。我已经对所有服务进行了docker化,并且当前遇到了一个奇怪的错误,该错误无法执行ssh所需的身份验证脚本。 docker镜像同时
好的,我想到了这个,并且很好奇它是否可能。在 linux 系统上,有什么方法可以生成有效的算法密码组合来登录 SSH,我们可以用一个小的应用程序或设备生成有效的密码(比如一些银行的互联网界面,如果你愿
我的情况是 sshd 应该只允许 sftp 访问一组用户。 这很容易通过添加一个匹配部分来完成 Match Group groupname ChrootDirectory /srv/ftp
我正在尝试构建一个 hadoop Dockerfile。 在构建过程中,我添加了: && apt install -y openssh-client \ && apt install -y o
有没有办法运行sshd以便它可以(至少对于有限数量的登录)成功返回提示(可能是 busybox),即使 fork 不可用(例如,PID 不足)? 在我看来,这应该是可能的,例如,sshd 预 fork
由于/var/log/secure 中的以下错误(根据调试日志),我无法登录 SSH: Dec 19 18:01:05 hostname sshd[25119]: debug1: trying pub
谁能给我指出一些使用 SSHD 访问服务器并从 JAVA 应用程序执行一些命令的示例代码。我浏览了 Apache SSHD 网站和下载,但就文档和示例代码而言,还没有发现任何有用的东西。我还用谷歌搜索
我在 ubuntu 上遇到 SSHD 问题。我试图通过使用 AllowGroups 来限制可以远程登录的帐户,从而在 SSH 服务器上提供更强大的安全性。不幸的是,不在允许组中的用户似乎仍然可以登录并
我正在尝试安装 hadoop,我需要重新启动 sshd 服务以配置节点之间的连接...但是,每当我写:service sshd restart 消息错误将显示告诉我此服务无法识别。 安装这个系统有什么
我正在尝试获取服务器的公钥。这是我尝试过的: val serverKey = sshClient.connect("dyn mem", "localhost", "2222") .verify()
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
1,服务器链接不上 ? 1
我正在尝试关注 Apache MINA 的 guide用于设置 SSHD 服务器,但在使用 PuTTY 连接到它时遇到问题。我开始输入用户名,但随后收到以下错误消息: 下面是我的服务器的代码。我是否必
我找到了这个 Dockerfile sample here : // version 1 FROM ubuntu:latest RUN apt update && apt install ssh -
如何配置 SSHD 以在 Docker 中运行?我正在尝试编写一个单元测试来检查一些 SSH 登录命令,但我无法让容器通过 SSH 登录到自身。 我有 Dockerfile: FROM ubuntu:
我有一个docker容器,需要使用-d标志作为守护进程运行。 有没有办法指定我要运行/ usr / sbin / sshd作为此容器的启动过程? 我已经尝试过了,但是我的容器没有停留在周围: 须藤 j
我目前正在制作一个简单的安全审计脚本,它将为配置中的每个不匹配打印 OK/Error。 场景是下一个 - 例如,对于 SSHD_Config,如果情况下,我会放在下一个: if [ "`grep -E
我是一名优秀的程序员,十分优秀!