樹莓派

软件列表,主要有几个值得说的,代理软件(chisel, 
pi@raspberrypi:~ $ ls -l
total 28416
-rw-r--r-- 1 pi pi    3612 Dec 12 13:40 1.txt
-rwxrwxrwx 1 pi pi 7340032 Sep  4 20:02 chisel
-rwxr-xr-x 1 pi pi    3854 Apr 30  2019 chisel!
-rwxrwxrwx 1 pi pi 7143424 Feb 18  2021 chisel_1.7.6_linux_armv7
-rwxrwxrwx 1 pi pi 7405568 Apr  2  2020 chisel-linux-arm
-rwxr-xr-x 1 pi pi      88 Apr 30  2019 chiselserv.sh
drwxr-xr-x 3 pi pi    4096 Sep  5  2020 Desktop
drwxr-xr-x 2 pi pi    4096 Sep  5  2020 Documents
drwxr-xr-x 2 pi pi    4096 Sep  5  2020 Downloads
-rw-r--r-- 1 pi pi     256 Jan 30  2020 edit.dat
-rw-r--r-- 1 pi pi    3988 May  4  2019 fail.txt
-rw-r--r-- 1 pi pi     115 May 18  2019 getnat.py
drwxr-xr-x 9 pi pi    4096 Jun 11  2019 ggez
-rw-r--r-- 1 pi pi    1898 May  1  2019 icfonfig.txt
-rw-r--r-- 1 pi pi   10652 Apr 25  2019 index.html

top - 13:40:06 up  1:03,  2 users,  load average: 0.30, 1.34, 1.89
Tasks: 114 total,   1 running,  69 sleeping,   0 stopped,   0 zombie
%Cpu(s): 18.9 us, 20.1 sy,  0.0 ni, 58.5 id,  1.1 wa,  0.0 hi,  1.4 si,  0.0 st
内存大小1gb,空闲一半,使用才60MB
KiB Mem :   949448 total,   522824 free,    60208 used,   366416 buff/cache
KiB Swap:   102396 total,   102396 free,        0 used.   815804 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
18510 root      20   0    8108   3292   2816 R  15.8  0.3   0:00.07 top
    1 root      20   0   28244   6108   4860 S   0.0  0.6   0:06.66 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd
    4 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/0:0H
    6 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 mm_percpu_wq
    7 root      20   0       0      0      0 S   0.0  0.0   0:02.22 ksoftirqd/0
    8 root      20   0       0      0      0 I   0.0  0.0   0:12.68 rcu_sched
    9 root      20   0       0      0      0 I   0.0  0.0   0:00.00 rcu_bh
   10 root      rt   0       0      0      0 S   0.0  0.0   0:00.02 migration/0
   11 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/0
   12 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/1
   13 root      rt   0       0      0      0 S   0.0  0.0   0:00.01 migration/1
   14 root      20   0       0      0      0 S   0.0  0.0   0:00.97 ksoftirqd/1
   16 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/1:0H
   17 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/2
   18 root      rt   0       0      0      0 S   0.0  0.0   0:00.01 migration/2
   19 root      20   0       0      0      0 S   0.0  0.0   0:01.07 ksoftirqd/2
   21 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/2:0H

分区状况,一个15GB的SD卡,已经几乎满了
pi@raspberrypi:~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G   14G  970M  94% /
devtmpfs        460M     0  460M   0% /dev
tmpfs           464M     0  464M   0% /dev/shm
tmpfs           464M   18M  446M   4% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           464M     0  464M   0% /sys/fs/cgroup
/dev/mmcblk0p6   65M   22M   44M  34% /boot
tmpfs            93M     0   93M   0% /run/user/1000


bashrc启动脚本
pi@raspberrypi:~ $ cat .bashrc

这是主要的我改的部分,涉及到代理(cisel,vpnserver,pptpd,)
TODO:iptable这一行是啥意思?

sudo ./chisel server -v -p 端口 --socks5 --reverse --auth 賬號:密碼 t &

sudo /usr/local/vpnserver/vpnserver  start &

#sudo service pptpd restart

#sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

sudo memcached -l 0.0.0.0:11212 &
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE


研究为何他能够sudo不需要输入密码
link:https://www.jianshu.com/p/5d02428f313d

pi@raspberrypi:~ $ sudo cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

关键在于文件/etc/sudoers.d/010_pi-nopasswd 

pi@raspberrypi:~ $ sudo ls /etc/sudoers.d
010_at-export  010_pi-nopasswd  README

pi@raspberrypi:~ $ sudo cat /etc/sudoers.d/README
#
# As of Debian version 1.7.2p1-1, the default /etc/sudoers file created on
# installation of the package now includes the directive:
#
#       #includedir /etc/sudoers.d
#
# This will cause sudo to read and parse any files in the /etc/sudoers.d
# directory that do not end in '~' or contain a '.' character.
#
# Note that there must be at least one file in the sudoers.d directory (this
# one will do), and all files in this directory should be mode 0440.
#
# Note also, that because sudoers contents can vary widely, no attempt is
# made to add this directive to existing sudoers files on upgrade.  Feel free
# to add the above directive to the end of your /etc/sudoers file to enable
# this functionality for existing installations if you wish!
#
# Finally, please note that using the visudo command is the recommended way
# to update sudoers content, since it protects against many failure modes.
# See the man page for visudo for more information.
#
这个文件是关键
pi@raspberrypi:~ $ sudo cat /etc/sudoers.d/010_pi-nopasswd
pi ALL=(ALL) NOPASSWD: ALL
pi@raspberrypi:~ $ sudo cat /etc/sudoers.d/
010_at-export    010_pi-nopasswd  README
pi@raspberrypi:~ $ sudo cat /etc/sudoers.d/010_at-export
Defaults env_keep += "NO_AT_BRIDGE"
pi@raspberrypi:~ $

Powered by Jekyll and Theme by solid

本站总访问量