2017-07-18 605 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的你,即使你從本地終端分離。