Articles of ssh

劫持来自服务器的SSH连接来控制客户端

尴尬的问题:由于某种原因,我无法通过SSH访问我们的Linux服务器。 其他一切正常。 由于它没有graphics卡(我不得不删除它来为另一个网卡留出空间),我只能通过在键盘上打字来“盲目”地控制它。 通过盲目input,我设法消除防火墙作为一个问题,通过停用。 我重新启动服务器,但SSH似乎并没有出现。 现在我设法启动从服务器到我的工作站的SSH连接。 有什么办法可以劫持那个连接来获得我可以从我的工作站控制的服务器上的terminal? 由于SSH守护进程根本不启动,因此使用隧道不起作用。 服务器是Ubuntu 8.04 LTS盒,我的工作站是Ubuntu 11.04。 在服务器上运行以下软件: Apache与mod_php BIND FTP CUPS Postgres的 MySQL的 SANE

sftp和公钥

我正在尝试进入由其他人托pipe的服务器。 为了确保这个工作,我做了标准的sftp [email protected]我与密码,并认为工作正常。 我正在设置一个cron脚本来每周发送一个文件,所以给了我们我们的公钥,他们声称已经添加到了authorized_keys文件中。 我现在再次尝试sftp [email protected] ,我仍然提示input密码,但现在密码不起作用… Connecting to [email protected][email protected]'s password: Permission denied, please try again. [email protected]'s password: Permission denied, please try again. [email protected]'s password: Permission denied (publickey,password). Couldn't read packet: Connection reset by peer 但我注意到,如果我只是按下enter (没有密码),它logging了我的罚款… 所以这是我的问题: 有没有办法来检查我的sftp连接使用的是哪个privatekey / pulbickey对? 是否可以指定要使用的密钥对? 如果全部设置正确(使用正确的密钥对并添加到授权文件中)为什么我被要求input一个空密码? 感谢您的帮助提前! 更新我刚刚运行sftp -vvv [email protected] …. debug1: Authentications that can continue: publickey,password […]

如何在sshlogin后在远程服务器上自动定义函数和别名

我想在login时自动在远程shell中定义bash函数和别名。 我不能把这些定义放到.profile或类似的地方,因为我login的用户经常与使用相同系统的其他用户共享,而我无法控制这个。 我想要做的是在远程进程中执行几个bash函数定义,然后继续作为loginshell。 我试过这个,但没有奏效: cat ~/.profile – | ssh -tt user@host bash -l 有任何想法吗?

在sshd上启用密码authentication,现在键盘交互式authentication挂起

OS X系统10.8如果有关系。 我启用了内置sshd密码validation,因此更改了PasswordAuthentication的设置: # To disable tunneled clear text passwords both PasswordAuthentication and # ChallengeResponseAuthentication must be set to "no" PasswordAuthentication yes PermitEmptyPasswords yes # Change to no to disable s/key passwords ChallengeResponseAuthentication yes 这确实启用了密码validation,但是由于某种原因,它似乎也影响了键盘validation。 如果我尝试进入机器(没有select),它永远挂起。 如果我使用ssh -vvv ,发送键盘交互数据包后,可以看到它挂起: debug1: Authentications that can continue: publickey,password,keyboard-interactive debug3: start over, passed a different list publickey,password,keyboard-interactive debug3: preferred […]

如何通过SSH将git用户转发到gitserver?

我试图通过SSH门户设置SSH / GIT访问,但谷歌已经空了。 基本上我想要从用户git的任何连接到我的SSH入口被转发到我的SSH服务器,以便我可以远程进行推和拉。 但是,如果任何其他用户连接,我希望他们像往常一样login。 internet–(git)–>gate–(git)–> git-server internet–(user)–>gate 任何帮助或build议将不胜感激。 在客户端执行此操作的一种方法是将以下内容添加到.ssh / config中: Host git.life-hack.org HostName git.life-hack.org ProxyCommand ssh [email protected] nc %h %p User git 但是我希望能有办法做这个服务器端。

OpenSSH服务器接受公钥,然后立即closures连接,没有任何错误消息

我试图连接到一个SSH服务器,我可以连接到过去,但使用不同的OpenSSH客户端版本。 从Cygwin OpenSSH_6.6.1, OpenSSL 1.0.1g 7 Apr 2014客户端,通过使用Cygwin OpenSSH_6.6.1, OpenSSL 1.0.1g 7 Apr 2014通过Squid代理,我很好地连接到中间的Ubuntu 13.10 OpenSSH_6.2p2 Ubuntu-6ubuntu0.3服务器使用转发的代理绕过防止直接访问目标服务器的防火墙。 我可以很好地连接到其他SSH服务器通过这个中间服务器,排除转发的代理configuration或权限问题。 我可以告诉目标服务器失败的唯一区别是,它使用OpenSSH_4.3运行一个旧的Debian版本,虽然几个月前我可以连接到OpenSSH_4.3 ,但几年前还没有更新(在升级中间服务器之前跟随心跳的错误)和升级我的Cygwin客户端之前。 最近和一些较老的OpenSSH用户代理之间是否有任何已知的协议不兼容问题? 从中间服务器连接到目标服务器( s1.hidden.com @63.82.7.10在下面的跟踪)失败,没有任何错误消息,目标服务器已经报告接受我转发的公钥,中间服务器发送公共键。 在下面的跟踪中,到中间服务器的连接和到目标服务器的尝试连接都有选项-vvv ,它解释了涉及转发代理的channel 1debugging消息(地址被编辑): […] debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 279 debug2: input_userauth_pk_ok: fp 46:83:33:00:28:48:b2:3c:b1:3f:60:bb:62:80:cc:d2 debug3: sign_and_send_pubkey: RSA 46:83:33:00:28:48:b2:3c:b1:3f:60:bb:62:80:cc:d2 debug2: channel […]

使用npm install作为MS-Windows系统帐户

我有一个节点应用程序运行在Windows上,我想能够自动更新。 当我运行npm install -d作为Administrator帐户 – 它工作正常,但是当我试图通过我的自动化软件(即作为local system运行)运行它时,我遇到错误,当我尝试从私人安装专用模块git存储库: npm ERR! git clone [email protected]:team/repository.git fatal: Could not change back to 'C:/Windows/system32/config/systemprofile/AppData/Roaming/npm-cache/_git-remotes/git-bitbucket-org-team-repository-git-06356f5b': No such file or directory npm ERR! Error: Command failed: fatal: Could not change back to 'C:/Windows/system32/config/systemprofile/AppData/Roaming/npm-cache/_git-remotes/git-bitbucket-org-team-repository-git-06356f5b': No such file or directory npm ERR! npm ERR! at ChildProcess.exithandler (child_process.js:637:15) npm ERR! at ChildProcess.EventEmitter.emit (events.js:98:17) npm ERR! […]

连接到OS X上的EC2实例的ssh超时问题

我是AWS的新手,而不是networking专家,但很想知道更多。 我创build了一个只有公有子网的VPC。 然后,我使用Ubuntu 14.04 64位pv AMI映像(ami-e84d8480)创build了一个EC2实例,并生成了通过ssh连接到它的密钥对。 我遵循亚马逊的指示,通过ssh连接到一个EC2实例,没有工作。 这是我尝试的input和debugging日志: 在OS X 10.9.4上运行 user$ ssh -vvv -i key.pem [email protected] OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: /etc/ssh_config line 102: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22. […]

如何让OpenSSH使用OCSP进行撤销

正如标题所说,是否有任何(免费)库,补丁等允许configurationOpenSSH通过OCSP(在线证书状态协议)检查x.509证书撤销? 如果是这样,你能指点我的文档和/或下载页面吗? (是的,我正在问OpenSSH而不是OpenSSL。) 提前致谢。 [请注意,我在StackOverflow上发布了这个问题 ,但没有人回答,所以这可能是一个更好的场所。]

可靠的autossh系统服务

我尝试为autossh创build一个可靠的systemd服务。 该服务工作,但如果主机密钥更改,服务处于状态正常(正在运行)。 如果隧道不工作,我希望它处于“失败”的状态。 这是我目前的systemd服务文件: # Source is in srv/salt/tunnel/autossh\@.service # which is a git repo. # Don't edit /etc/systemd/system/autossh\@.service [Unit] Description=Tunnel For %i After=network.target [Service] User=autossh # https://serverfault.com/a/563401/90324 ExecStart=/usr/bin/autossh -M 0 -N -o "ExitOnForwardFailure yes" -o "ConnectTimeout=1" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 40443:installserver:40443 -R 8080:installserver:8080 tunnel@%i Restart=always [Install] WantedBy=multi-user.target 这里是systemctl status autossh@foo-work的输出 salt:/srv […]