2017-07-18 604 views
0

我转发端口,这样我只能连接到另一台计算机可见的服务器上运行的jupyter笔记本。我有这个工作,但我想这样做,所以我的SSH会话与我在其他设置中使用-f选项实现的终端会话分离。这是我目前做的:中使用SSH -t和-f选项

ssh -t [email protected] -L 8008:localhost:8009 'ssh -L 8009:localhost:8008 [email protected]' 

这让我连接通过连接到本地主机连接到host2上的端口8008上运行的jupyter笔记本:8008我的本地计算机上。当我尝试使用-f选项我得到了以下错误:

Pseudo-terminal will not be allocated because stdin is not a terminal. 
Pseudo-terminal will not be allocated because stdin is not a terminal. 
Permission denied, please try again. 
Permission denied, please try again. 
Permission denied (publickey,password). 

那么,如何实现有-f的效果,同时使用-t?或者我只需要有一个终端会话登录到host2?

+1

你的问题是更适合于[超级用户](http://superuser.com/tour)。这个网站是用于编程相关的问题。 – Cyrus

回答

0

由于stdin不是终端,伪终端将不会被分配。

您需要使用-tt(双-t),这将分配TTY的你,即使你从本地终端分离。