ssh-remote-port-forwarding

1、ssh免密码登录(A登录到B)
  1.1、在A上执行并在~/.ssh下生成id_rsa和id_rsa.pub两个文件

ssh-keygen -t rsa -P ‘‘

  1.2、拷贝id_rsa.pub到B的~/.ssh/authorized_keys文件中

scp ~/.ssh/id_rsa.pub [email protected]192.168.1.100:~/.ssh/authorized_keys

  1.3、ssh公钥生效需满足至少下面两个条件
    1)、.ssh目录的权限必须是700
    2)、authorized_keys文件权限必须是600
  1.4、在A上免密登录到B

ssh [email protected]192.168.1.100

2、ssh远程端口反转

ssh -R <local port>:<remote host>:<remote port> <SSH hostname>

  2.3、A上执行

ssh -i ~/.ssh/id_rsa.pub -o StrictHostKeyChecking=no -NfR 2026:127.0.0.1:22 [email protected]192.168.1.113

  2.4、B上执行

ssh -p 2026 [email protected]127.0.0.1
时间: 2024-10-25 03:36:43

ssh-remote-port-forwarding的相关文章

How to do SSH Tunneling (Port Forwarding)

In this post we will see how ssh works?, what is SSH tunneling? what is important of ssh tunnels and how to setup the ssh tunnel.When SSH server is installed in machine then by default its allowed ssh tunneling. SSH Tunneling (Port Forwarding) Tunnel

SSH 动态端口forwarding是如何工作的

好久没有来了,实在是太懒. 经常用SSH的动态端口forwarding 来FQ,使用像这样的命令: ssh -D 9999 -f -C -q -N sshHost.somewhere.com 这个命令会建立一个tunnel到指定的远程SSH主机,这样你连接本机9999端口,并在所建立连接上读写的任何数据都会被tunnel到远端主机,从而达到FQ的效果. 一直以为SSH这个命令里面做了很复杂的事情(比如实现连接管理和端口映射)来实现这么一个功能,但总觉得对一个小工具来说,它做的太多了,而且这个显然

Port Forwarding in Windows

转自:http://woshub.com/port-forwarding-in-windows/ Since Windows XP there is a built-in ability in Microsoft Windows to set up network ports forwarding. Due to it, any incoming TCP connection (IPv4 or IPv6) to local port can be redirected to another lo

USRP E310启用SSH的X11 Forwarding功能

SSH的X11 Forwarding功能提供了一个非常好的方法,在你的本地主机上执行远程主机的GUI程序. 1.USRP E310中做如下配置: 打开/etc/ssh/sshd_config,并添加如下两项: AllowTcpForwarding yesX11Forwarding yes 2.远程客户端中执行:ssh -X [email protected]_addr,即可.

port forwarding in yosemite, a way to replace ipfw

login as root, or do the following in sudo. create a file /etc/pf.anchors/com.pow, add following two lines with new line breaker at the end: rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080 rdr pass on lo0 inet proto tcp

路由器port触发与转发---Port Forwarding &amp;amp; Port Triggering

What is Port Triggering? If you have not read my explanation of port forwarding do so now. You can find it here. Port triggering is pretty simple once you know what port forwarding is. Port Triggering is port forwarding with an on/off switch for the

Pycharm远程调试之ssh remote debug(二)

Pycharm远程调试之ssh remote debug (一) 上一篇我们讲了怎么去初步创建一个远程debug的工程,这篇我们来更深一下,讲一下当我们要修改Interperter时要怎么做. 1.创建一个工程,我们先将该工程使用local Interpreter,然后再把修改为remote Interpreter,看看我们需要怎么做(没那么简单的) 2.修改我们的Project Interpreter 为我们那好的remote Interpreter(在上一篇文章里) 3.添加Path map

路由器端口触发与转发---Port Forwarding &amp; Port Triggering

What is Port Triggering? If you have not read my explanation of port forwarding do so now. You can find it here. Port triggering is pretty simple once you know what port forwarding is. Port Triggering is port forwarding with an on/off switch for the

NAT&amp;Port Forwarding&amp;Port Triggering

NAT Nat,网络地址转换协议.主要功能是实现局域网内的本地主机与外网通信. 在连接外网时,内部Ip地址需要转换为网关(一般为路由器Ip地址)(端口号也需要相应的转换) 如:QQ程序 在一个局域网中,路由器(网关)WAN侧ip为200.0.0.123 局域网三台计算机:计算机A 192.168.0.10,计算机B 192.168.0.20,计算机C 192.168.0.30 分别登陆一个qq程序,在各自机子上,IP和Port分别为 计算机A 192.168.0.10:4000,计算机B 192

SSH port forwarding: bind: Cannot assign requested

说明 我在进行正常的ssh端口转发并登入远程服务器时,发现系统给予了报错的提示,下面是我的操作流程和系统报错: ssh -f -p 1234 [email protected] -L 1111:192.168.246.194:22 -N 执行上面命令,系统提示报错: bind: Cannot assign requested address或者bind [::1]:1111: Address not available 排查 使用如下命令进行排查发现: ssh -v -f -p 1234 [em