Articles of ssh

似乎无法禁用根login

我试图禁用root密码login,只允许在debian 7上用ssh密钥进行rootlogin。 cat << EOF >> /etc/ssh/sshd_config PasswordAuthentication yes UsePAM no PermitRootLogin without-password AllowUsers root test Port 433 LoginGraceTime 1m ClientAliveInterval 600 ClientAliveCountMax 0 EOF service ssh restart 我将这些命令作为部署脚本的一部分运行,但是仍然可以使用根密码(而不是使用ssh密钥)以root用户身份login。 我已经阅读了很多教程,我似乎无法明白为什么会发生这种情况。

如何改变stream浪者的SSH密码方法,从密码到私钥?

我使用Snappy Ubuntu Core(15.04 stable)在Mac OS(10.10.3)上运行vagrant(1.7.2),用于docker,使用VirtualBox 4.3.28作为提供程序。 我可以通过Macterminal中的私钥方法在Ubuntu客户端操作系统中手动ssh。 但“stream浪ssh”命令坚持密码的方法,我不知道如何改变auth方法。 vagrant up Bringing machine 'default' up with 'virtualbox' provider… ==> default: Checking if box 'ubuntu/ubuntu-15.04-snappy-core-stable' is up to date… ==> default: Clearing any previously set forwarded ports… ==> default: Clearing any previously set network interfaces… ==> default: Preparing network interfaces based on configuration… default: Adapter 1: nat […]

Ubuntu上的ssh第一次失败:非对称路由,SSH连接无法正常build立

我一直对这个问题感到困惑…我有一个子网10.128.0.1上的exs主机和10.128.20.1子网上的guest。 我有另一个10.128.0.1子网10.124.18.1上的虚拟机… 路由器是简单的多宿主包含所有三个子网的主要局域网10.128.0.1和多宿主10.128.18.1和10.128.20.1 … 我可以ssh给10.128.18.1客人的任何客人,但对于10.128.20.1客人,我只能ssh只有一次,然后必须重新启动客人? 我看到数据包通过tracedump到达客户虚拟机…但由于某种原因,连接刚刚超时,或者正在等待某些事情。 我没有在sshd_configclosuresuseDNS ,因为本地DNS服务器仍然没有configuration…认为这是影响它。 不知何故,我认为这是我的sshdconfiguration问题,但不能磨练它… 这是我的sshd_config : Port 22 Protocol 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key UsePrivilegeSeparation yes KeyRegenerationInterval 3600 ServerKeyBits 768 SyslogFacility AUTH LogLevel DEBUG LoginGraceTime 120 PermitRootLogin no StrictModes yes RSAAuthentication yes PubkeyAuthentication yes IgnoreRhosts yes RhostsRSAAuthentication no HostbasedAuthentication no PermitEmptyPasswords no ChallengeResponseAuthentication no X11Forwarding yes X11DisplayOffset 10 […]

将服务器A连接到服务器B上的数据库并转发服务器A上的远程数据库端口

编辑:我很新虽然所有这些pipe理员的东西! 那么,将服务器A上的端口连接到服务器B上的数据库的最佳方式是什么? 我想这样做的原因:我想连接服务器A到服务器B上的cassandra数据库。我读到这可以通过SSH隧道工作…但是这真的是两个服务器之间的最佳select只? 有人可能举个例子吗?

保持跟踪SSH私钥没有评论

SSH公共密钥支持注释(仅仅由附加在密钥末尾的文本组成),这使得识别一个不可识别的id_rsa.pub文件变得很容易。 您可以使用注释来存储信息,例如密钥的属性,创build时间以及使用的机器等信息。 私钥似乎缺less此function。 ssh-keygen -C comment将会生成一个密钥对,注释会附加到公钥上,但私钥将保持不注释状态。 ssh-keygen有一个-c参数,“请求改变私钥和公钥文件中的注释”,但是 root@kitsune:~# ssh-keygen -c -f id_rsa Comments are only supported for RSA1 keys. 所以看起来SSH2私钥格式没有注释字段。 只要把这对钥匙放在一起并保留在正确的位置,这种做法基本上没有问题,但是这些文件可以被复制和移动(这可能发生在帐户/机器共享密钥时)或者意外覆盖,而且它们都有同名(id_rsa),所以可以跟踪哪个键是哪个。 在没有评论的情况下,保持私钥有组织的最佳做法是什么?

ssh_dispatch_run_fatal:连接到xxxx端口22:密钥types不匹配

我遇到了一个奇怪的错误与SSH到Sonicwall设备,我无法解决。 这个问题似乎只发生在OS X(10.11)的SSH内置。 我可以成功ssh到除了OS X以外的其他各种设备的防火墙。 我看到的错误是:ssh_dispatch_run_fatal:连接到xxxx端口22:键types不匹配 试图围绕这个包裹我的头,但没有任何运气。 这是使用-vvv时的输出。 OpenSSH_6.9p1, LibreSSL 2.1.8 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to hostname [xxxx] port 22. debug1: Connection established. debug1: identity file /Users/hjlinde/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /Users/hjlinde/.ssh/id_rsa-cert […]

通过多个ssh隧道复制文件

我有一个尴尬的情况,我需要通过多个隧道链接到一台机器。 详情为什么在下面,但是这个命令适用于sshing到server2 : ssh -A -t [email protected] ssh -A -t [email protected] ssh -A -t [email protected] ssh -A [email protected] (为简洁起见,该命令现在是$ssh_cmd )如何使用类似的隧道设置将文件复制到/从该机器? 我曾尝试过,例如: rsync –rsh=ssh -e "$ssh_cmd" [email protected]:filename . 即使在删除-t ,它也会失败,因为它不会给我input密码的机会: debug1: Next authentication method: password debug1: read_passphrase: can't open /dev/tty: No such device or address debug1: Authentications that can continue: publickey,password Permission denied, please try again. […]

将SSH转发到其他主机

我有一个从互联网上可见的Ubuntu服务器,我们称之为“跳线”。 而这个服务器有这个名字实际上是因为我需要当用户SSH这个服务器,它跳转(或转发或redirect)SSH连接到另一个服务器(这是不可见的互联网),所以SSH实际上是不可见的服务器。 此外,我需要完全用iptables来做到这一点。 我试过(跳线) iptables -t nat -A PREROUTING -d ${jumper_ip} -p tcp –dport 22 -j DNAT –to-destination ${invisibleserver_ip} iptables -t nat -A POSTROUTING -s ${invisibleserver_ip} -p tcp –sport 22 -j SNAT –to-source ${jumper_ip} iptables -A FORWARD -p tcp ${invisibleserver_ip} –dport 22 -m state –state NEW,ESTABLISHED,RELATED -j ACCEPT 是的,在Kernel上启用IP转发。 问题 当我SSH跳线主机,没有任何反应。 “连接超时”出来。 任何想法? 谢谢大家的答案。

如何在Windows上使用OpenSSH证书?

OpenSSH支持使用证书颁发机构对用户密钥进行签名。 从man ssh-keygen : ssh-keygen supports signing of keys to produce certificates that may be used for user or host authentication. Certificates consist of a public key, some identity information, zero or more principal (user or host) names and a set of options that are signed by a Certification Authority (CA) key 在纯Linux环境中,SSH证书非常易于使用。 没有问题的服务器部分( TrustedUserCAKeys […]

当使用压缩时,openssh会以100%的cpu挂起

当请求压缩( ssh -C )时,ansible openssh服务器挂起100%cpu, ssh -vvv -C root@host […] debug3: send packet: type 50 debug3: receive packet: type 52 debug1: Enabling compression at level 6. debug1: Authentication succeeded (publickey). Authenticated to host debug1: channel 0: new [client-session] debug3: ssh_session2_open: channel_new: 0 debug2: channel 0: send open debug3: send packet: type 90 debug1: Requesting [email protected] […]