'ssh'에 해당하는 글 4건



1) modify '/etc/ssh/sshd_config' as follows

TCPKeepAlive yes

GatewayPorts yes

ClientAliveInterval 60

ClientAliveCountMax 999999999


2) based on "external_server -- firewall -- internal_server" structure,


we can run following command on internal_server


$ sudo ssh -fN -R *:7777:localhost:22 id@external_server_ip -p 2222


where sshd port for external_server_ip is 2222 and port 7777 can be any available ports on external_server. 


3) connection.


on external_server, we can run following command to connect internal_server


$ ssh localhost -p 7777







WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,

ssh tunnel

카테고리 없음 2016. 4. 1. 09:26

출처 : http://dokumentasifreebsd.blogspot.kr/2015/02/ssh-tunnel-in-30-seconds-mac-osx-linux.html?m=1


Launch an SSH tunnel

To initiate your SSH tunnel, simply [open Mac OSX / Linux Terminal][1] and connect to your remote server via SSH with the following flags:
ssh -D 8080 -C -N username@example.com
This will launch our SSH tunnel on port 8080 and route all traffic (securely) through the server at example.com.

Browse the Web with Your SSH Tunnel (Chrome)

Now, let’s start browsing the web using our new SSH tunnel.
Mac OSX:
  1. Open Google Chrome
  2. Select ‘Chrome’ up the top left
  3. Select ‘Preferences’
  4. Select ‘Show advanced settings…’
  5. Select ‘Change proxy settings…’
  6. Select ‘SOCKS Proxy’
  7. Enter ’127.0.0.1′
  8. Enter port ’8080′
  9. Save changes by selecting ‘OK’
Fedora Linux:
  1. Open Google Chrome
  2. Select the wrench icon on the top right
  3. Select ‘Settings’
  4. Select ‘Show advanced settings…’
  5. Select ‘Change proxy settings…’
  6. Select ‘SOCKS Proxy’
  7. Enter ’127.0.0.1′
  8. Enter port ’8080′
  9. Save changes by selecting ‘OK’
Search Google for ‘my ip’ and take a look at what your IP address is now. Cool right? 

Exiting the SSH Tunnel

To exit the SSH tunnel, simply disable the SOCKS proxy within your browser.
Hope this helps, let me know if you have any suggestions in the comments below!



WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,

You can define that you want to keep the connection alive in the ssh configuration. You have to edit (create if it does not exist):

~/.ssh/config

Add these two lines to it:

ServerAliveInterval 300
ServerAliveCountMax 36

The value ServerAliveInterval defines the interval in seconds between two noop operations that keeps to connection alive. It is 5 minutes in this case. 
The value ServerAliveCountMax defines the number of times the noop is sent. In this case the connection will be kept open for 3 hours.


WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,

출처 : http://wpscale.com/how-to-ping-and-ssh-ubuntu-guest-host-virtualbox/

How to  SSH from CentOS to Ubuntu Guest Host Virtualbox

By default SSH & ping between Virtualbox Guest and Host is disabled. Virtualbox make NAT connection between Host and Guest so we can have internet connection in Guest. To make Host and Guest can communicate in two ways, here are the steps :

1. Create vboxnet0 network device. 
If you don’t have this vboxnet, you will have empty in Network Adapter preferences.
So, open Virtualbox and go ” File -> Preferences -> Network “.

Add host-only by press + (plus) button.

2. Create new Network adapter in Guest
Right-click into your Guest Virtualbox, select “Settings”. Go to “Network -> Adapter2″.
Attached into host-only adapter and select name into vboxnet0.

3. Start your Guest
In mine, I use Ubuntu as Guest & Host OS. So, in after login into Guest, you should check if host-only adapter works or not. Do “sudo ifconfig eth1″ :

1
2
3
4
5
6
7
8
eth1      Link encap:Ethernet  HWaddr 08:00:27:97:1c:69  
          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe97:1c69/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1684 (1.6 KB)  TX bytes:9659 (9.6 KB)

192.168.56.101 is your Guest IP.
Now on host, you can do ssh ubuntu@192.168.56.101.

If eth1 doesn’t have any IP, then we should assign static IP by edit “/etc/network/interfaces”

1
2
3
4
auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0

And reboot your Guest. After reboot, check your IP again.

4. For easy mouse and keyboard switch between Guest & Host
Run your Virtualbox Guest machine. On menu Devices, select install guest additions.


WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,