ssh by Bluetooth

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
sudo apt-get install bridge-utils bluez python-dbus python-gobject
sudo ufw disable
sudo service bluetooth start
sudo update-rc.d bluetooth enable
sudo apt-get install bluez-tools
sudo nano /etc/systemd/network/pan0.netdev
输入:
[NetDev]
Name=pan0
Kind=bridge

sudo nano /etc/systemd/network/pan0.network
输入:
[Match]
Name=pan0

忽略:
#[Network]
#Address=192.168.6.6/32
#Gateway=192.168.6.6
#DHCPServer=yes
#IPForward=yes

[Network]
Address=fe80::aa16/64
DHCPServer=ipv6

sudo nano /etc/systemd/system/bt-agent.service
输入:
[Unit]
Description=Bluetooth Auth Agent

[Service]
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput
Type=simple

[Install]
WantedBy=multi-user.target

sudo nano /etc/systemd/system/bt-network.service
输入:
[Unit]
Description=Bluetooth NEP PAN
After=pan0.network

[Service]
ExecStart=/usr/bin/bt-network -s nap pan0
Type=simple

[Install]
WantedBy=multi-user.target

sudo systemctl enable systemd-networkd
sudo systemctl enable bt-agent
sudo systemctl enable bt-network
sudo systemctl start systemd-networkd
sudo systemctl start bt-agent
sudo systemctl start bt-network

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

IPTABLES='/usr/sbin/iptables'

# Set interface values

EXTIF='wlan0'

INTIF1='pan0'

# enable ip forwarding in the kernel

/bin/echo 1 > /proc/sys/net/ipv4/ip_forward

# flush rules and delete chains

$IPTABLES -F

$IPTABLES -X

# enable masquerading to allow LAN internet access

$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

# forward LAN traffic from $INTIF1 to Internet interface $EXTIF

$IPTABLES -A FORWARD -i $INTIF1 -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT

#echo -e " - Allowing access to the SSH server"

$IPTABLES -A INPUT --protocol tcp --dport 22 -j ACCEPT

#echo -e " - Allowing access to the HTTP server"


ssh by Bluetooth
https://b.limour.top/134.html
Author
Limour
Posted on
May 31, 2020
Licensed under