GithubHelp home page GithubHelp logo

iahunter / checkmyip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from packetsar/checkmyip

1.0 1.0 0.0 37 KB

A Telnet and SSH Based Public IP Address Lookup Service

License: GNU General Public License v3.0

Python 100.00%

checkmyip's Introduction

CheckMyIP (TelnetMyIP.com) CheckMyIP

A Telnet, SSH and Simple HTTP Based Public IP Address Lookup Service


USAGE

  • TELNET: telnet telnetmyip.com
  • SSH: ssh sshmyip.com
    • Your SSH client may require you to enter a username. You can use anything you want (ssh -limrootbitch telnetmyip.com)
  • CURL: curl telnetmyip.com
  • WGET: wget -qO- telnetmyip.com

VERSION

The version of CheckMyIP documented here is: v1.3.0


TABLE OF CONTENTS

  1. What is CheckMyIP
  2. How to Use
  3. Using the API
  4. Install Process
  5. 1.0.0 TO 1.1.0 Updates
  6. Contributing

WHAT IS CHECKMYIP

Everybody has used a service like WhatIsMyIP.com before. If you are an IT engineer or even an amateur technology enthusiast, then you have probably had a reason to check to see your public IP address. This service works great when a browser is available, but at times it is not. We often find ourselves logged into a remote Linux machine or a network switch/router which has a command line and terminal clients (Telnet and SSH), but no browser. The CheckMyIP app and the TelnetMyIP.com and SSHMyIP.com public services were created with this in mind.


HOW TO USE

Using the public TelnetMyIP.com and SSHMyIP.com services is pretty easy: simply connect to them with a terminal client. You can use a telnet client with TCP port 23 (telnet telnetmyip.com), a SSH client with TCP port 22 (ssh sshmyip.com), or CURL (curl telnetmyip.com). The SSH connection requires no authentication, but your SSH client may require you to enter a username, you can use anything you want as it gets ignored anyways(ssh -limrootbitch telnetmyip.com).

You can also browse to the HTTP version of the service at TelnetMyIP.com which will return a JSON reply with your IP information.

To enable the use of this service as a simple API, the response is formatted as a JSON document. See the Using the API section for information on how to leverage the API.

Note: You can also connect to ipv4.telnetmyip.com or ipv6.telnetmyip.com if you want to check a specific IP stack.

Note: The DNS records for telnetmyip.com and sshmyip.com point to the same services.


USING THE API

The CheckMyIP code contains the CheckMyIP_Client class which is an API client example which can be used to query a CheckMyIP server (like telnetmyip.com). Below is an example of how you can use it.

from checkmyip import CheckMyIP_Client

client = CheckMyIP_Client()
ipdict = client.get()
print("\nMy IP is %s\n" % ipdict["ip"])
print("\nI used port number %s\n" % ipdict["port"])

INSTALL PROCESS

If you would rather set up your own private instance of CheckMyIP, then you can follow the below instructions to set it up for yourself.

Change Linux SSH Port to TCP 222 and reboot

sudo sed -i --follow-symlinks 's/#Port 22/Port 222/g' /etc/ssh/sshd_config

shutdown -r now

Install Dependencies

sudo apt install python3-pip
sudo -H pip3 install paramiko
sudo apt install python3-gssapi

Clone Repo

git clone https://github.com/PackeTsar/checkmyip.git

Create Service (sudo nano /etc/systemd/system/checkmyip.service)

[Unit]
Description=CheckMyIP Service
After=network-online.target
Wants=network-online.target

[Service]
Type=simple

PIDFile=/var/tmp/checkmyip.pid
WorkingDirectory=/home/ubuntu/checkmyip

ExecStart=/usr/bin/python3 checkmyip.py

Restart=on-failure
RestartSec=30
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Finish and Start Up Service

sudo systemctl daemon-reload
sudo systemctl enable checkmyip
sudo systemctl start checkmyip
sudo systemctl status checkmyip

UPDATES IN V1.0.0 --> V1.1.0

NEW FEATURES:

  • Was seeing issues where SSH would be very slow to exchange. Likely related to log file sizes, so I change the logging function to turnover to new logging files every day.

UPDATES IN V1.1.0 --> V1.3.0

  • README updated for install on Ubuntu instead of CentOS
  • Small tweaks to support Python3

CONTRIBUTING

If you would like to help out by contributing code or reporting issues, please do!

Visit the GitHub page (https://github.com/packetsar/checkmyip) and either report an issue or fork the project, commit some changes, and submit a pull request.

checkmyip's People

Contributors

packetsar avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.