PuTTY SSH Port Forwarding

SSH Tunnel with PuTTY

PuTTY can produce more than just terminal sessions, with the option SSH port forwarding can be initialized in simple ways.

After PuTTY is started, you enter the IP of the target host under host name, or the server name, which is usually a firewall, a router or a host with a global IP address.

PuTTY Configuration
PuTTY Configuration

Here in our example, on the host 212.117.203.98, our PBX is made with the port forwarding to a SIP phone, and then configured via the web browser, the host can also be an FQDN of a DNS resolvable host.

Here in our example, on the host PBX is made with the port forwarding to a SIP phone
PuTTY SSH port forwarding

In the lower part of SSH, the tunnel point is selected. After that, the starting point and the end point of the tunnel are entered:
Source port: 8888
Destination: 172.30.10.10

PuTTY SSH port forwarding
PuTTY SSH port forwarding

The action is completed with a click on Add. The data from the tunnel has now been adopted. The settings are saved above under Session by clicking on Save Permanent.

Clicking on Load and Open will establish the connection. The well-known terminal console opens with the prompt to log in. There you log in as a normal user, so the tunnel is established.

Now you open the web browser and enter the following localhost address https://127.0.0.1:8888/. After that, as here in our example, the login dialog of the SIP-Phone WebGUI begins, which we can now configure. Other ways to use SSH tunnels are available for Synology DS, SAN Memory, Unix/Linux Hosts, or Mac OS X.

Note. The SSH option AllowTcpForwarding yes must be enabled on the server, default is yes entered in the server configuration file /etc/ssh/sshd_config.

For the host behind a firewall, it must be accessible via port 22 Static NAT forward.

PuTTY can be used by passing numerous parameters.

PutTY Link
PuTTY shortcut

Insert the following line as the target for the link:
“C:\Program Files (x86)\PuTTY\PUTTY. EXE” -l jolly -pw password -4 -L 8888:172.30.10.10:80 -X :0 -load PBX

Wherethe parameters mean the following:
-l the login name
-pw the password
-4 it should be used IPv4
-L of the Destination Port and the IP
-X for X11 forwarding
-load open saved session

Linux Top 20 Shell Commands

Linux command line examples from practice with 20 commonly used commands

You don’t want to see a complete list here, but there may be a start for some of the common Linux commands.

1. Translate ASCII character set to octal, decimal, and hexadecimal

Translate ASCII character set to octal, decimal, and hexadecimal with man ascii
man ascii

2. Output calendar to console

Calendar view 6 months with week number, cal -n 6 -w

Calendar view 6 months with week number

3. Edit binary hexadecimal in VIM

4. Compare two files

5. Find content in files recursively using find

6. Send a file as e-mail

7. Download multiple URLs from list

8. Remove duplicate lines with awk

Line output of /etc/passwd with the same uid and gid

9. Conversion from Windows/DOS (CR/LF) to Unix (LF) format

10. Recursive String Search in Files

11. How many CPMs does my computer have?

12. View Free Memory

13. View active processes

14. Create directory tree (tree)

15. Output Asterisk PBX Applications

16. Number of MTA emails identified by SPAM

17. How long does the computer run

18. Set time and date

19. Who am I and the effective user ID, UID and GID output

20. Output list of most recently logged in users

Server Memory cache buffers reset

Linux admin does not know this, according to a conscience uptime almost all memory is used up for cache and buffers of the server, actually it is not necessary to intervene in the memory management of the system, but the system is scarce in memory, this can be prevent with a simple script.

free_mem

After login as root and open the script in editor:

$ vi /usr/sbin/clearcache.sh

Now make the script executable.

and run as crontask at 5, 1 3 and 9 p.m.

Use free -m to observe free memory before and after the reset, the task is also logged under /var/log/clearcache.log and can be output to stdout with “tail /var/log/clearcache.log”.

clear cache
clear cache