• 欢迎光临~

ssh的使用

开发技术 开发技术 2022-11-20 次浏览
ssh的使用

 

Example:

在本地(local)上运行

ssh  -L   the-local-listening-port:localhost:the-host-listening-port  root@server-host-addr

此时,在本地(local)上通过

localhost:the-local-listening-port

就可以访问remote的资源。

架构(User Case)如下:

user(working using a small PC or laptop)   ->    local     -> remote(host or server)

下面是另外一个话题:

 

ssh的使用

 

 在本地(local)上运行

ssh    -R  the-local-listening-port:localhost:the-host-listening-port  root@server-host-addr

然后在server端,就可以访问local的某个地址和端口所提供的服务,比如NAS等。

 

架构(User Case)如下:

user(looking at the server's screen)   ->    server(host) -> local(But this 'local' now reside in 'remote')

尽量不要使用一些公共的已经定义好的端口,否者可能失败。 

 

程序员灯塔
转载请注明原文链接:ssh的使用
喜欢 (0)
违法和不良信息举报电话:022-22558618 举报邮箱:dljd@tidljd.com