顯示具有 ssh 標籤的文章。 顯示所有文章
顯示具有 ssh 標籤的文章。 顯示所有文章

2009年6月21日 星期日

Secure your Linux Server

1. disable ssh login as root

vi /etc/ssh/sshd_config
--

..
PermitRootLogin no
..

2. disable root login in phpmyadmin

vi config.inc.php
--

..
$cfg['Servers'][$i]['AllowRoot'] = FALSE;
..

2007年11月19日 星期一

SOCKS Forwarding With OpenSSH on Linux

Run ssh on linux

ssh -D port user@host

-D Specifies a local ``dynamic'' application-level port forwarding.
This works by allocating a socket to listen to port on the local side.
The SOCKS4/5 protocols are supported, and ssh will act as a SOCKS server.

Run putty on Windows

1. Connection -> SSH -> Tunnels
2. type port number into "Source port" then add to set up dynamic fowarding for a listening local port
3. leave Destination blank
4. select Dynamic and Auto
5. fill Hostname and Port of ssh eonnction then Open
6. if you wanna keep the session alive by sending null packets periodically, go to Connection then input seconds

2007年8月14日 星期二

Connect through SSH tunnel on Windows

1. Download Plink (a command-line interface to the PuTTY back ends)
2. Execute it with parameters on a windows machine

# -C enable compression
# -N don't start a shell/command (SSH-2 only)
# -v show verbose messages
# -ssh force use of SSH protocol
# -L [listen-IP:]listen-port:host:port
# Forward local port to remote address
plink.exe -C -N -v -ssh -L local_port:remote_ip:remote_port -l ssh_username ssh_server_ip

3. Then you could have localhost:port forwarded to remote server with encryption