Difference between revisions of "Ssh - reverse ssh untuk tunnel web lokal ke vps"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) (Created page with "Di VPS domain-nya misalnya coba.vps.com Server Lokal (80) -- coba.vps.com (80)<--- user http://coba.vps.com ==di Server Lokal== ssh -NR portvps:localhost:portlocal u...") |
Onnowpurbo (talk | contribs) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
Server Lokal (80) -- coba.vps.com (80)<--- user http://coba.vps.com | Server Lokal (80) -- coba.vps.com (80)<--- user http://coba.vps.com | ||
+ | |||
+ | Atau bisa di coba | ||
+ | |||
+ | * [[Ngrok]] | ||
==di Server Lokal== | ==di Server Lokal== | ||
ssh -NR portvps:localhost:portlocal user@domain.di.vps | ssh -NR portvps:localhost:portlocal user@domain.di.vps | ||
− | ssh -NR 80:localhost:80 user@coba.vps.com | + | |
+ | untuk coba.vps.com:8080 ke localhost:80 | ||
+ | |||
+ | ssh -NR 8080:localhost:80 user@coba.vps.com | ||
+ | |||
+ | |||
+ | untuk coba.vps.com:80 ke localhost:80 bisa di coba | ||
+ | |||
+ | ssh -R \*:80:localhost:80 -N user@coba.vps.com | ||
==Di Server VPS== | ==Di Server VPS== | ||
Edit sshd_config | Edit sshd_config | ||
+ | |||
+ | sudo vi /etc/ssh/sshd_config | ||
Tambahkan | Tambahkan | ||
Line 20: | Line 34: | ||
AllowTcpForwarding yes | AllowTcpForwarding yes | ||
GatewayPorts yes | GatewayPorts yes | ||
+ | |||
+ | Restart | ||
+ | |||
+ | sudo su | ||
+ | /etc/init.d/ssh restart | ||
+ | |||
+ | |||
+ | ==Dari sisi User== | ||
+ | |||
+ | http://coba.vps.com:8080 |
Latest revision as of 20:14, 18 February 2022
Di VPS domain-nya misalnya
coba.vps.com
Server Lokal (80) -- coba.vps.com (80)<--- user http://coba.vps.com
Atau bisa di coba
di Server Lokal
ssh -NR portvps:localhost:portlocal user@domain.di.vps
untuk coba.vps.com:8080 ke localhost:80
ssh -NR 8080:localhost:80 user@coba.vps.com
untuk coba.vps.com:80 ke localhost:80 bisa di coba
ssh -R \*:80:localhost:80 -N user@coba.vps.com
Di Server VPS
Edit sshd_config
sudo vi /etc/ssh/sshd_config
Tambahkan
AllowTcpForwarding yes GatewayPorts yes
Restart
sudo su /etc/init.d/ssh restart
Dari sisi User
http://coba.vps.com:8080