https://github.com/jdtoombs/server-sandbox
Things I am playing around with on a sandbox server
https://github.com/jdtoombs/server-sandbox
Last synced: 2 months ago
JSON representation
Things I am playing around with on a sandbox server
- Host: GitHub
- URL: https://github.com/jdtoombs/server-sandbox
- Owner: jdtoombs
- Created: 2024-12-30T21:18:45.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-12-31T07:34:42.000Z (4 months ago)
- Last Synced: 2024-12-31T08:25:31.312Z (4 months ago)
- Language: Lua
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Random notes
### ssh commands
- `ssh-keygen` to generate key for ssh auth
- use `sshfs` to mount remote repo and use local text editor to write scripts### tcpdump commands
You can exclude traffic from a specific ip address source by doing the following.
- `tcpdump not src host ip.addr.here and not src host ip.addr2.here`
- `-n` to avoid resolving host names (just show numbers)
- `tcpdump -n dst host ip.addr.here` for only seeing incoming traffic.### digital ocean default
- `eth0` and `eth1` are the only public facing network interfaces on default digital ocean setup### use iptables to blacklist connections
- `iptables -L INPUT --line-numbers` to list the current rules (ips banned etc.)
- `iptables -A INPUT -s ip.address.here -j DROP` to add someone to the blacklist
- `iptables -F` to flush out the rules### debugging / useful commands
- `hostname -I` list all the hostnames the server uses
- `echo $SSH_CLIENT` shows who you are connected as
- check who is currently connect with `who`### auth logs
`/var/log/auth.log` contains authorization logs for things like login attempts.
- `cat /var/log/auth.log | grep "Invalid user"` to see attempts to ssh into server### cron jobs
- `crontab -e` to edit cron jobs
- `crontab -l` to list the current cron jobs### ports
Ports that were most targeted in ssh attempts...
- `80` - http
- `22` - ssh
- `443/8443` https