Programmer's Blog

Programmer's reference

Category Archives: ssh

[RHEL] Allow SSH connection

1. open
/etc/ssh/sshd_config

2. unsharp the statement
PermitRootLogin=yes

3. restart the service by
#> service sshd restart

[SSH] Port forwarding

suppose we have host1 (local) and host2, we want to forward host2:10001 to host1:10000

so that we can access the host2 port 10001 by opening it on port 10000 of host1.

someone@host1$> ssh -f -g -N -L 10000:localhost:10001 someone@host2

To remove the port forwarded, useĀ  the following to find and kill the ssh process

someone@host1$> ps aux | grep ssh