LoginSignup
0
0

More than 1 year has passed since last update.

Raspberry pi 3 B+ 設定備忘録

Last updated at Posted at 2018-10-27

Squid

Web Proxy

install

$ sudo apt install squid

Config

$ sudo vi /etc/squid/squid.conf

SSH

/etc/ssh/sshrc

HOOK="$Discord_webhook"

DATE=`date +"%Y/%m/%d %H:%M:%S"`
curl -H "Content-Type: application/json" -X POST \
    -d "{\"username\": \"raspi_ssh\", \"content\": \"$USER has logged in from [$SSH_CLIENT] at $DATE  \"}" $HOOK &

OpenVPN

pivpnでインストール

/etc/openvpn/server.conf

# on connection/disconnection
script-security 2
client-connect "/usr/local/vpn/connect.sh"
client-disconnect "/usr/local/vpn/disconnect.sh"

/usr/local/vpn/

connect.sh 

#!/bin/bash

HOOK=""

DATE=`date +"%Y/%m/%d %H:%M:%S"`
curl -H "Content-Type: application/json" -X POST \
            -d "{\"username\": \"raspi_vpn\", \"content\": \"$common_name has connected from [$untrusted_ip] as [$ifconfig_pool_remote_ip] at $DATE  \"}" $HOOK &

disconnect.sh

#!/bin/bash

HOOK=""

DATE=`date +"%Y/%m/%d %H:%M:%S"`
curl -H "Content-Type: application/json" -X POST \
            -d "{\"username\": \"raspi_vpn\", \"content\": \"$common_name has disconnected from [$untrusted_ip] as [$ifconfig_pool_remote_ip] at $DATE  \"}" $HOOK &

Others

  • usb on/off:
$ hdparm -S 120 /dev/sda
  • ssh / reverse ssh
  • mpd / mpc
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0