Articles of ssh

rsync – 无法解释的错误

我正在使用这样的脚本: rsync -avu –delete –progress user@host:~/backup . 每一次,过了一段时间,收到这个错误: rsync: connection unexpectedly closed (10251754 bytes received so far) [receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(226) [receiver=3.1.0] rsync: connection unexpectedly closed (45482 bytes received so far) [generator] rsync error: unexplained error (code 255) at io.c(226) [generator=3.1.0] # generator = Debian 5, […]

用sshconfigurationpam做2因素authentication

我正在尝试使用自定义radius服务器来configurationssh进行身份validation。 所以我想要的是,首先它应该使用当前的sshlogin(unixlogin)进行身份validation,然后提示用户input第二个radius的密码。 我正在设置/etc/pam.d/sshd,如下所示 auth required pam_unix.so debug **auth sufficient /lib/security/pam_radius_auth.so debug conf=/home/pam_radius try_first_pass** 但是,我的第一个身份validation并没有发生。 它立即进入半径。 按照pam_radius ..try_first_pass ….如果没有以前的密码,或者以前的密码authentication失败,用“inputRADIUS密码:”提示用户,并要求input另一个密码。 尝试使用此密码,并根据情况返回成功/失败。

如何限制SSH / SFTP用户到apache网站的子文件夹?

我目前在Linux服务器上设置Apache,需要创build一个新的用户,可以login,只能编辑特定目录中的文件。 我目前有我的网站设置为 /数据/ htdocs中/ mywebsite / 这个权限是apache:apache 现在我需要做的是创build一个新的用户“joeblogs”,并限制此用户只能访问/ data / htdocs / mywebsite / store / 用户应该可以SSH和SFTP,但总是直接导向到这个文件夹,用户也应该能够完全访问/存储/文件夹,但无法看到任何其他文件夹或文件系统/ 任何帮助,将不胜感激,我一直在圈了几个小时。

在Ubuntu上保留/lockingssh的内存?

是否有可能locking/保留ssh / auth和bash操作的内存和CPU优​​先级? 因为当服务器溢出时,我无法通过ssh连接,因为它在ssh auth上冻结。 也许某种程度上限制了最大允许的整体内存使用量和处理器功耗

SSHd根据用户名执行操作

我的虚拟主机使用一个优雅的方式来处理多个站点,同时保持每个站点独立。 对于我通过ssh ,我使用以下: ssh hostname -l username1_sitename1 这做了一些沿着chroot我到特定的目录相关的sitename1和改变我的UID匹配的行。 如果我使用ssh hostname -l username1_sitename2等等,则相同。 username1的login每次使用相同的密码,并且hostname保持不变。 如果另一个用户username2需要访问sitename1则他们可以使用类似的scheme访问该站点: ssh hostname -l username2_sitename1 并且在访问sitename1时将会获得与username1相同的UID。 我希望在我的一台电脑上复制类似的scheme。 是否有可能实现这一点,而无需手动添加username_sitename每个化身到系统?

服务器突然变得对SSH没有反应

服务器突然变得对SSH没有反应,我报告了它以前发生在另一台服务器,我大约2个月前。 服务器设置是CentOS6 64位,它运行一个非常基本的apache2服务器,提供静态文件,并且应该承受非常小的负载,因为它背后大量caching的Amazon CloudFront。 我被告知要查看/var/log/messages但是当我在问题发生的时候打开它(2012年2月27日18:00左右),那里有很多消息,我不知道它们是什么意思,谷歌search没有太大的帮助,所以我想知道如果有更有经验的人可以看看这个日志,并告诉我,如果他们看到任何奇怪的。 Feb 26 03:06:02 173 kernel: imklog 4.6.2, log source = /proc/kmsg started. Feb 26 03:06:02 173 rsyslogd: [origin software="rsyslogd" swVersion="4.6.2" x-pid="1439" x-info="http://www.rsyslog.com"] (re)start Feb 26 04:20:01 173 auditd[1414]: Audit daemon rotating log files Feb 26 13:37:09 173 auditd[1414]: Audit daemon rotating log files Feb 27 08:03:03 173 auditd[1414]: Audit daemon […]

无法通过SSH向瞻博networking防火墙发送命令

我有一些我需要pipe理的Juniper SSG防火墙,我希望能够通过一些监控脚本向他们发送命令。 我使用公钥configurationSSH访问,我可以自动login到防火墙。 当我交互地运行SSH时,一切工作正常: $ssh <firewall IP> FIREWALL-> <command> <command output> FIREWALL-> exit Connection to <firewall IP> closed. $ 但是当我尝试从命令行运行命令时,它不起作用: $ssh <firewall IP> <command> $ 当然,在向远程Linux机器发送一个命令时, $ssh <linux box IP> <command> <command output> $ 为什么发生这种情况? 交互式运行SSH和指定命令在SSH命令行上运行有何区别? 更新: 它也适用于Cisco路由器。 只有这些瞻博networking防火墙似乎performance得如此。 从SSH的debugging输出中,看起来连接已经正确build立,但Juniper框在发送命令时用EOF回复,而Linux框则用实际的命令输出回应: Linux的: debug1: Authentication succeeded (publickey). debug1: channel 0: new [client-session] debug2: channel 0: send open […]

如何在AIX上通过SSHconfigurationX11转发?

这是我试过的。 我在远程AIX系统上编辑了/ etc / ssh / sshd_config X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost yes 以及设置$ DISPLAY DISPLAY=localhost:10.0 export DISPLAY …重启 通过RHEL连接 ssh -X me@hostname 运行xclock xclock 得到以下输出: X11 connection rejected because of wrong authentication. X connection to localhost:10.0 broken (explicit kill or server shutdown) 还xauth list不打印任何东西。

SSH密钥问题:不是RSA1密钥文件未知密钥types“—– BEGIN”

backuppc服务器能够以root用户身份login到远程计算机上并进行备份,但是如果我以backuppc用户身份login并尝试使用同一个密钥sshlogin到这些计算机,该密钥将被拒绝,并显示以下debugging信息: OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013 debug1: Reading configuration data /var/lib/BackupPC/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to XXX.XXXXXX.com [XX.XXX.XX.XX] port 222. debug1: Connection established. debug1: identity file /var/lib/BackupPC/.ssh/identity type -1 debug1: identity file /var/lib/BackupPC/.ssh/identity-cert type -1 debug3: Not a RSA1 key file /var/lib/BackupPC/.ssh/id_rsa. […]

Fail2Ban不添加iptables规则

Fail2Ban不添加iptables规则来阻止攻击者。 我正在运行CentOS 6.5(32位) 以下是我所做的: 通过yum使用EPEL回购安装fail2ban。 我将jail.conf复制到jail.local 。 我把jail.local的禁令时间改为3600 bantime = 3600 对于iptables我有这些关于SSH定义的规则 Chain INPUT (policy ACCEPT) num target prot opt source destination 1 ACCEPT all — 0.0.0.0/0 0.0.0.0/0 2 ACCEPT all — 0.0.0.0/0 0.0.0.0/0 state ESTABLISHED 3 fail2ban-SSH tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 4 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 我的jail.localconfiguration为SSH: [ssh-iptables] enabled […]