大网数据广告活动
服务器运维问答

Converting SSH command to a PuTTY command

· 52CE 我爱测

I am trying to translate the SSH command: ssh -N -L 1521:server1.com:1521 [email omitted] into PuTTY. -N : Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only). -L [bind_address:]por…

问题原文

原帖链接 · Franck Dernoncourt · CC BY-SA 3.0

I am trying to translate the SSH command:

ssh -N -L 1521:server1.com:1521 [email omitted]

into PuTTY.

  • -N: Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only).
  • -L [bind_address:]port:host:hostport: Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side.

The command first SSH to [email omitted], which in turn connect to server1 so that it fowarrds port 1521 (server behind NAT).

In a more abstract way, the command could be written as:

ssh -L MY_LOCAL_PORT:FOREIGN_ADDRESS:FOREIGN_PORT MYUSER@SSH_SERVER

I tried to write the following PuTTY command:

putty -N -D 1521 -P 1521 server2.com [email omitted]

with:

  • -N: suppress starting a shell or command.
  • -D: set up SOCKS-based dynamic port forwarding on a local port.
  • -P: specify a port number

according to the PuTTY manual.

However I get:

What could be the issue?

I disabled the firewall, and checked that putty.exe allowed to communicate with Internet.


Using the PuTTY GUI, the tunnel works with the following configuration:

已采纳解答

原帖链接 · ALex_hha · CC BY-SA 3.0

I am trying to translate the SSH command ssh -N -L 1521:server1.com:1521 [email omitted] into PuTTY.

If all you need is just forwarding port - you can use plink instead

> plink.exe -ssh -N -L 1521:server1.com:1521 [email omitted]

I'd curious how to fix the putty.exe command as well

the same things

> G:\putty.exe -ssh -P 2222 -N -L :2222:192.168.88.130:2222 [email omitted] -i C:\Users\ALex\.ssh\node1.ppk

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-03-23)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。