Articles of ssh

从OpenVPN服务器SSH到OpenVPN客户端

我想从服务器本身通过SSH访问OpenVPN服务器的每个客户端。 我不想启用client-to-client设置,因为我不希望每个客户端彼此交谈。 我也不想访问客户端自己的子网上的机器,只是实际的机器。 我能够build立一个隧道,我可以从客户端SSH服务器,但不能做相反的事情。 通过VPN的服务器的IP:10.4.0.1 来自ipp.txt : 客户端A通过VPN的IP:10.4.0.4 客户端B通过VPN的IP:10.4.0.8 服务器configuration: port 1194 proto udp dev tun ca ca.crt cert server.crt dh /etc/openvpn/rsa/keys/dh2048.pem server 10.4.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "route 172.31.0.0 255.255.0.0" push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 208.67.222.222" push "dhcp-option DNS 208.67.220.220" keepalive 10 120 comp-lzo user nobody group nobody persist-key persist-tun status openvpn-status.log […]

如何在使用SSH-Key时禁用Google计算引擎重置SFTP文件夹权限

目前运行Google计算引擎实例并在服务器上使用SFTP。 按照以下步骤将用户locking到SFTPpath: https : //bensmann.no/restrict-sftp-users-to-home-folder/ 要将用户locking到某个目录,该用户的主目录需要由root拥有。 最初,设置工作正常,但发现Google计算引擎零星地将权限“自动重置”回给用户 。 我正在使用在Google云端控制台中设置的SSH密钥,并且该密钥与用户名相关联。 我的猜测是Google Compute Engine正在使用这个“元数据”,并重新configuration文件夹权限以匹配与SSH密钥关联的用户的权限。 有什么办法可以禁用这个“自动重置”吗? 或者,有没有更好的方法来托pipeSFTP并locking单个用户到SFTPpath,而不必将主文件夹所有权更改为root?

无法通过SSH连接到“Bash for Windows”(WSL)

我试图从我的Linux机器SSH到WSL,并没有运气到目前为止。 我研究过: https://superuser.com/questions/1123552/how-to-ssh-into-wsl https://github.com/Microsoft/BashOnWindows/issues/300 https://superuser.com/questions/1111591/how-can-i-ssh-into-bash-on-ubuntu-on-windows-10 我尝试了几乎所有的东西。 closures防火墙,不同的端口,AllowUsers,PermitRootLogin,UsePrivilegeSeparation等我其实可以ssh从Windows框到我的linux的盒子没有问题。 而且,因为我closures了windows系统上的防火墙,所以在debugging连接(从Linux到WSL)时,我也得到了一个“build立连接”: $ ssh -vvv 192.168.2.8 -p 2222 OpenSSH_7.5p1, OpenSSL 1.1.0e 16 Feb 2017 debug1: Reading configuration data /home/user/.ssh/config debug1: /home/user/.ssh/config line 1: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug2: resolving "192.168.2.8" port 2222 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to 192.168.2.8 [192.168.2.8] port 2222. debug1: […]

在ssh中通过证书进行身份validation – 我是否正确地执行该操作

我已经阅读了各种有关如何设置身份validation没有密码的文章,只有通过证书,我没有一个共同的解决scheme:有人build议这一点,其他。 如何正确地做到这一点? 这个configuration工程,是的,但也许有我应该删除的东西? 或者我应该添加其他东西? # /etc/ssh/sshd_config: ChallengeResponseAuthentication no UsePAM no PermitRootLogin no PasswordAuthentication no PermitEmptyPasswords no RSAAuthentication yes PubkeyAuthentication yes 我的问题是关于这个configuration特别是我不需要更多的链接来阅读。

在ssh服务器中加载特定于连接主机名的.zshrc文件

我想在远程主机上用我的电脑连接到某个.zshrc文件。 与任何其他连接机器,我需要一些其他的默认configuration。 例如,远程主机上的.zshrc文件中可能存在类似的行: if [[ connecting_host_is_mypc ]]; then # do something … else # do something else … fi 我想我应该把这个绑定到特定的公共密钥,完成这个的最好方法是什么?

使用AWS的.PEM文件,要求input密码

我正在使用macOS Sierra,几个月来一直在使用AWS,而且我一直都在使用 ssh -i file.pem [email protected] 但是今天当我尝试连接时,我被要求inputpem文件的密码。 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: 'key.pem' Enter passphrase for key 'key.pem': 我没有设置密码,现在无法连接到我们的服务器 有什么build议? 注意 :我在AWS门户上创build了密钥。 然后下载它。

ssh的“ChrootDirectory”function是否被认为是安全的?

我知道chroot通常不被认为是安全的,并不是作为安全function而devise的。 所以我的问题是: 我是否正确,chroot一个SSH用户(与ChrootDirectory )是不安全的,不会阻止该用户逃脱? 如果是的话,为什么你会根本用户? 是chroot用户和限制他到SFTP(与ForceCommand internal-sftp SFTP)更安全? 有没有办法打破这个?

SSH密钥连接失败时如何告诉Ansible提示用户密码?

我和一群害怕linux的networking工程师一起工作,我正在为我的团队创build一个无缝的用户体验。 如何创build一个条件:当密钥validation失败时,提示用户input用户名和密码? 这是我迄今为止: — – name: Get facts from core1.site1 Junos router hosts: routers connection: local gather_facts: no roles: – Juniper.junos vars_prompt: – name: netconf_user prompt: Username private: no – name: netconf_password prompt: Password private: yes register: results vars: default_port: 830 tasks: – name: Get Junos Facts junos_get_facts: host: "{{ inventory_hostname }}" ######I would like […]

如何pipe理特定用户的SSH帐户?

我有几个用户,他们连接到我的服务器从他们的客户端(特定客户端)通过SSH,所以我为他们生成AuthorizedKeys 。 现在我有两个用户UserA和UserB ,我希望这些用户能够用任何设备或任何IP地址连接到我的服务器,关键是我不想为他们授权密钥。 可能吗 ? 现在,当他们想连接到服务器,它说, permission denied (publickey) 我甚至尝试将这一行添加到sshd_config: AllowUsers UserA UserB 但其他船员只是看到 permission denied 我的sshd_config # Package generated configuration file # See the sshd_config(5) manpage for details # What ports, IPs and protocols we listen for Port 22 # Use these options to restrict which interfaces/protocols sshd will bind to #ListenAddress :: […]

ssh不连接,详细模式下没有错误

我不能从任何机器ssh到我们的服务器之一(在同一个networking)。 我尝试在详细模式下运行ssh,但没有得到任何错误: vincent@feed01:/var/cache/feed$ ssh -vvv [email protected] OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to feed02.xxx.com [192.168.0.161] port 22. debug1: Connection established. debug1: identity file /home/vincent/.ssh/id_rsa type -1 debug1: identity file /home/vincent/.ssh/id_rsa-cert type -1 debug1: identity file […]