我在 Windows 7 上使用 VirtualBox 来运行 Fedora 7。正如/sbin/service sshd status我所说,我似乎打开了 SSH 。当我做一个时/sbin/ifconfig,我得到这个:
eth0 链接封装:以太网 HWaddr 08:00:27:CF:5A:0B
inet 地址:10.0.2.15 Bcast:10.0.2.255 掩码:255.255.255.0
我ssh 10.0.2.15从 Fedora 内部执行一个操作,然后连接回客户机。
当我ipconfig在 Windows 机器上执行操作时,我得到以下信息:
以太网适配器 VirtualBox Host-Only 网络:
特定于连接的 DNS 后缀。:
链路本地 IPv6 地址。. . . . : fe80::b42c:a852:a0e8:1636%19
IPv4 地址。. . . . . . . . . . : 192.168.56.1
子网掩码 。. . . . . . . . . . : 255.255.255.0
当我现在使用 PuTTY 连接到 192.168.56.1 …
我正在尝试将 mercurial 配置为在远程计算机上使用,该计算机在备用端口上运行sshd,并且我的登录需要使用密码的特定密钥。 ssh已配置并且工作正常,如下所示:
ssh -i ~/.ssh/id_rsa-xyz -p 1234 myuser@barney.example.com
Run Code Online (Sandbox Code Playgroud)
我的问题是hgrc文件中使用别名 ( barney-stuff) 或default-push属性中的任何一个进行此操作的内容:
hg push barney-alias
hg push
Run Code Online (Sandbox Code Playgroud)
我在 Mercurial 上看到的大多数ssh文档都假定默认端口和预加载的密钥。
我尝试将其添加到存储库的hgrc文件中:
ssh = /usr/bin/ssh -i /home/me/.ssh/id_rsa-xyz -p 1234
default = ssh://myuser@barney.example.com//hgroot/project1
Run Code Online (Sandbox Code Playgroud)
但是hg push只是挂起。
安装 cygwin sshd 后,sshd 服务失败并显示:
Error 1069: The service did not start due to a logon failure
Run Code Online (Sandbox Code Playgroud)
我尝试授予 cyg_server 标准用户和管理员访问权限。图形界面和cygrunsrv.exe -S sshd.
编辑:什么对我有用:
Install cyglsa-config
Run sshd with SYSTEM account
chown SYSTEM /var/empty
Run Code Online (Sandbox Code Playgroud) 我的服务器上的 SSHD 遇到了一些问题。我正在尝试设置无密码(pub/pv 密钥)身份验证。它适用于我的其他服务器,但不适用于此服务器。SSHD 代理将我的公钥添加到“授权密钥”中,但仍要求输入密码。我试图完全禁用密码身份验证(在 /etc/ssh/sshd_conf 中)以查看会发生什么,但我得到了“错误的 pub 密钥”。
pub 密钥由客户端发送 (ssh -vvv):
----
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/me/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/me/.ssh/id_dsa
----
## Next key (rsa was the good one)
Run Code Online (Sandbox Code Playgroud)
我检查了“sshd_config”和“.ssh”权限现在我只想能够看到服务器端发生了什么。我检查了我的“/var/log/auth”和“/var/log/secure”,但这里没有文件。
在配置中,我配置日志如下:
SyslogFacility AUTH
LogLevel DEBUG
Run Code Online (Sandbox Code Playgroud)
如何在不使用深度网络嗅探的情况下调试我的情况?是否可以将 Sshd 输出重定向到日志文件或 std ?
谢谢
ssh sshd public-key-encryption private-key password-protection
我正在运行 Debian 服务器(uname -v输出#1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23))。当我从多个客户端(带有默认 ssh 的 macOS 10.13 笔记本电脑、iOS 上的“提示”应用程序等)中的任何一个登录时LANG=C,尽管LANG=en_US.UTF-8从客户端传入。以下是一些相关信息:
client$ env | grep LANG
LANG=en_US.UTF-8
client$ ssh -v server
...
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
server$ env | grep LANG
LANG=C
server$ grep -in lang /etc/profile ~/.bash_profile ~/.bash_login ~/.profile ~/.bash_logout ~/.bashrc
grep: ~/.bash_profile: No such file or directory
grep: ~/.bash_login: No such file or directory
server$ locale -a
C
C.UTF-8
POSIX
en_US.utf8
server$ …Run Code Online (Sandbox Code Playgroud) 我正在编写一个使用 libssh 库的应用程序。我正在尝试建立从应用程序运行的客户端到服务器的连接。但是,我没有连接,而是收到一条错误消息:
[ERR]: Starting the SSH session failed (kex error : no match for method server host key algo: server [ssh-rsa], client [ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256]).
Run Code Online (Sandbox Code Playgroud)
我想更改服务器主机密钥算法以便可以建立连接,但我不知道在哪里执行此操作。我已经重新创建了我的服务器主机密钥。我认为我可以通过 进行配置/etc/ssh/sshd_config,但我无法找到正确的标志。我在服务器上的文件如下所示:
# $OpenBSD: sshd_config,v 1.97 2015/08/06 14:53:21 deraadt Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default …Run Code Online (Sandbox Code Playgroud) According to this, OpenSSH is now part of Windows. The executable files are in C:\Windows\System32\OpenSSH, and indeed I could see them on my system. However, sshd.exe is not there. Does anyone know why? Do I have to install something special to get sshd.exe?
My C:\Windows\System32\OpenSSH contains only the following items:
Directory: C:\Windows\System32\OpenSSH
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 19/03/2019 06:21 322560 scp.exe
-a--- 19/03/2019 06:21 390144 sftp.exe
-a--- 19/03/2019 06:21 882688 ssh.exe
-a--- 19/03/2019 …Run Code Online (Sandbox Code Playgroud) 我无法理解文件PermitTunnel中的选项sshd_config。该选项与 有何关系AllowTcpForwarding?似乎PermitTunnel no对通过隧道到服务器没有任何影响。
该男子这样说道PermitTunnel:
Specifies whether tun(4) device forwarding is allowed. The argument must be yes,
point-to-point (layer 3), ethernet (layer 2), or no. Specifying yes permits both
point-to-point and ethernet. The default is no.
Independent of this setting, the permissions of the selected tun(4) device must allow access
to the user.
Run Code Online (Sandbox Code Playgroud)
但这对我来说意义不大。
我启动了一个服务器,(太晚了)我发现 /etc/ssh/sshd.conf 发生了一些重大变化。我可以合理地确定重新启动 sshd 会保持现有连接吗?(这是在solaris上,但问题也适用于ubuntu)
我正在尝试以非 root 用户身份运行 SSH 守护进程,因为我想在我没有 root 访问权限的服务器上提供对 Git 存储库的 SSH 访问。我已经使用自定义配置和本地证书运行它,但登录当前无法正常工作。
我正在使用以下版本sshd:
OpenSSH_7.4p1、OpenSSL 1.0.2k-fips 2017 年 1 月 26 日
在此阶段,我不会寻求配置等方面的帮助(如果需要,我将发布单独的问题)。我只是想知道是否存在硬编码限制,这意味着在我投入更多时间之前这是不可能的。
SSH 守护程序中是否存在任何硬性限制,导致其无法作为非 root 用户成功使用?
sshd ×10
ssh ×7
debian ×2
windows-7 ×2
bash ×1
cygwin ×1
fedora ×1
linux ×1
mercurial ×1
openssh ×1
private-key ×1
services ×1
ssh-keys ×1
virtualbox ×1
windows-10 ×1