当前位置:   article > 正文

SSH 跳板机(堡垒机)登录大法_redhat8 cannot fork into background without a comm

redhat8 cannot fork into background without a command to execute

SSH log into remote host via auth host

A: local host, B: auth host, C: remote host

double SSH

ssh <userb>@<ipb> -p <portb>
[Enter]<pwdb>
[type :]ssh <userc>@<ipc> -p <portc> [default: 22]
[Enter]<pwdc>
  • 1
  • 2
  • 3
  • 4

SSH port forward

ssh -L <porta>:<ipc>:<portc> <userb>@<ipb> -p <portb>
[Enter]<pwdb>
[open a new terminal]
ssh <userc>@localhost -p <porta>
[Enter]<pwdc>
  • 1
  • 2
  • 3
  • 4
  • 5

Note: If you want to put this terminal to background, append the option “-Nf”]
-f means “Requests ssh to go to background just before command execution.”
-N means “Do not execute a remote command.”
if -N omitted, error occurs “Cannot fork into background without a command to execute.” So you have to imply that no cmd is gonna execute. Only pwd is typed in after the port forward cmd.
After this, you continue to type ssh cmd in local terminal.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/216191
推荐阅读
相关标签
  

闽ICP备14008679号