Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amboxer21/sshmonitor
Notifies you of any ssh attempts to your computer, whether the attempts are successful or not. Please fork instead of clone.
https://github.com/amboxer21/sshmonitor
c c-programming daemon gtk2 gui linux monitor notify pytailf python python2 python3 security ssh ssh-monitor
Last synced: 16 days ago
JSON representation
Notifies you of any ssh attempts to your computer, whether the attempts are successful or not. Please fork instead of clone.
- Host: GitHub
- URL: https://github.com/amboxer21/sshmonitor
- Owner: amboxer21
- License: gpl-3.0
- Created: 2017-03-31T19:39:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T22:05:21.000Z (6 months ago)
- Last Synced: 2024-11-02T03:03:31.258Z (16 days ago)
- Topics: c, c-programming, daemon, gtk2, gui, linux, monitor, notify, pytailf, python, python2, python3, security, ssh, ssh-monitor
- Language: Python
- Homepage:
- Size: 3.77 MB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README
- Changelog: changelog
- License: LICENSE
Awesome Lists containing this project
README
# SSHMonitorPy
Python implementation of SSHMonitor.rb.SSHMonitorPy notifies you of any ssh attempts to your computer, whether the attempts are successful or not.
Build program:
sudo python setup.py installRemove program:
python setup.py removeModify version in setup.py before building:
setup(
packages=[],
name='sshmonitor',
version='0.0.6', # increment version numberBuild package for PyPi:
python setup.py sdist
twine upload dist/*NOTE: If twine does not work with the above command you can try,
twine upload --repository-url 'https://upload.pypi.org/legacy/' dist/sshmonitor-0.0.6.tar.gzContents of ~/.pypirc:
[distutils]
index-servers =
pypi
pypitest[pypi]
repository=https://pypi.python.org/pypi
username=username
password='password'[pypitest]
repository=https://testpypi.python.org/pypi
username=username
password='password'Compile C Module
gcc -c -fPIC masquerade.c -o masquerade.o
gcc masquerade.o -shared -o libmasquerade.soor
gcc -shared -o libmasquerade.so -fPIC masquerade.c
Compile masquerade(uses pthread)
gcc masquerade.c -o masquerade -lpthreadBuilding libbuild.so
gcc -c -fPIC src/build.c -o libbuild.o
gcc libbuild.o -shared -o libbuild.so
cp -i src/lib/shared/libbuild.so src/lib/shared/original.libbuild.so
cp libbuild.so src/lib/shared/>>> import os
>>> import ctypes
>>> shared_object = 'libmasquerade.so'
>>> shared_object_path = os.path.join(*(os.path.split(os.path.__file__)[:-1] + (shared_object, )))
>>> User = ctypes.cdll.LoadLibrary(shared_object_path)
>>> User.masquerade('anthony')anthony@ghost:~/Documents/Python/sshmonitor/src$ sudo python
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, ctypes
>>> from ctypes import cdll
>>> libmasquerade = cdll.LoadLibrary('/home/anthony/Documents/Python/sshmonitor/src/libmasquerade.so')
>>> libmasquerade.masquerade('anthony')
anthonyCompile GTK UI
gcc notify-gtk.c -o notify-gtk `pkg-config --cflags --libs gtk+-2.0`Create shared object via gcc
gcc -shared -o libmasquerade.so -fPIC masquerade.c -lpthreadSet env
env DISPLAY=:0Debugging sshmonitor.py
sudo gdb --args python -dv sshmonitor.py --disable-email --verbose