Categories
HTTP Concepts Internet Technology Web Trends

How to use Telnet

TL;DR; Telnet is a network protocol that allows a user on one computer to log into another computer that is part of the same network.

Telnet is a text based application, often used at the command line of an operating system. Most importantly it uses the Telnet protocol (which is part of the TCP/IP protocol suite) to connect to a remote computer over a network. Keep in mind, telnet is an external command, which is available in certain microsoft operating systems as telent.exe. Running the telnet application requires different set of commands on different operating systems.

telnet
how telnet works

Example:

prompt$ telnet kumar.swatantra.info 23

Usage:

# telnet [host [port]]
telnet servername-or-ip [port-number]

Ports are specific gateways for Internet traffic to travel over. It’s similar to a large hallway with many doors leading outside. If a door is locked, you cannot access the outside world.

Telnet syntax

telnet [host [port]]

host Specifies the hostname or IP address of the remote computer.
port Specifies the port number or service name.

Commands available through the actual telnet program:

close Close current connection.
display Display operating parameters.
open Connect to a site.
quit Exit telnet.
set Set options (Type ‘set ?’ for a list).

NTLM Turn ON NTLM Authentication.
LOCAL_ECHO Turn ON LOCAL_ECHO.
TERM x (where x is ANSI, VT100, VT52, or VTNT)
CRLF Send both CR and LF
status Print status information.
unset Unset options (Type ‘unset ?’ for a list).

NTLM Turn OFF NTLM Authentication.
LOCAL_ECHO Turn OFF LOCAL_ECHO.
CRLF Send only CR (no LF is sent)
?/help Print help information.

Linux

  1. Open the your terminal application
  2. At the shell prompt, type: telnet exampleserver.com 23
  3. On a normal Unix machine the port is just the second argument on the command line.

Windows

  1. Click the start button
  2. Choose “run” from the start menu
  3. Type “cmd.exe” in to the run box
  4. At the cmd prompt, type: telnet exampleserver.com 23

Mac OS X

  1. Open the Applications menu or folder
  2. Select the Utilities folder
  3. Start the Terminal.app application
  4. At the shell prompt, type: telnet exampleserver.com 23
'Coz sharing is caring
Categories
linux PHP Technology

How to debug if phpinfo() is Disabled ?

Some server (hosting) providers choose to disable the PHP function phpinfo() for security reasons or say vulnerability in PHP 5.3 CVE-2014-4721, because it displays information which can be used to compromise the server that your site is running on. phpinfo() outputs almost every information about PHP’s configuration, such as the values of PHP directives, loaded extensions and environment variables.

In cases where phpinfo() is disabled, debugging problems in PHP is much more difficult. But, even though phpinfo() is disabled, you can still find that information using php’s core functions:

<?php
//PHP directives
echo ini_get(upload_max_filesize); // 2M

//Extensions/modules
print_r(get_loaded_extensions());

//Environment variables
print_r($_ENV);

//PHP or extension version
echo phpversion(); // 5.3.26
echo phpversion('pdo_mysql'); // 1.0.2
?>

In case you have SSH access to the server, “php -i” can also be used to get PHP configuration settings. For example, to get the configuration for the PDO – MySQL extension:

$ php -i|grep pdo_mysql

Or to get the version of PHP:

$ php -v

Though you can get lot of information without need of enabling phpinfo() but still if you want to enable it, learn “How to Enable and disable phpinfo()“.

'Coz sharing is caring