It can come handy to some Raspbian users with Raspberry Pi. In my case i did this on RPi4 and Raspbian 10 buster but most things should work also on other Raspberry or even on different HW and Linux. Use at your own risk.


Removing pi's root/superuser/sudo permissions and adding new super user:

sudo adduser newuser
sudo adduser newuser sudo
sudo delgroup pi sudo;sudo rm /etc/sudoers.d/*pi-nopasswd
Preventing cross account data reading and seeing processes of other users:

sudo su
echo "umask 077" >> /etc/profile
chmod -R go-rx /home/*/
sudo sed -i '/proc/s/defaults/defaults,hidepid=2/g' /etc/fstab
Protecting SSH from bruteforce and installing monitoring tools:

apt install ufw fail2ban htop nload nmon
chkconfig ufw enable
ufw limit ssh # reject SSH login attempts for 10 minutes from IP if it fails 6 times in 30 seconds
ufw deny in on eth0 to proto igmp
Setting up some new commands:

echo -e "alias myip='for ip in \$(curl -L 2>/dev/null);do echo \$ip && whois \$ip|grep -i netname;done'\nalias sensors='echo CPU: $(cat /sys/class/thermal/thermal_zone0/temp|cut -b -2)'\nalias kodi='sudo -u pi kodi --standalone &'" >> ~/.bashrc
logout and login, then:
myip - show your public IP
sensors - show cpu temperature
kodi - i do not recommend this alias to anyone

Install VeraCrypt and create new container to protect data:
apt install makeself openssl libfuse2 libwxbase3.0-0v5 -y;
wget -L -O veracrypt-1.21-raspbian-setup.tar.bz2
tar -vxjf ./veracrypt-1.21-raspbian-setup.tar.bz2;chmod +x veracrypt-1.21-setup-*;./veracrypt-1.21-setup-console-armv7
type "1" and hit enter
hit enter
hold spacebar until scrolled down
type "yes" and hit enter
enter key again
rm -rf veracrypt-*;openssl rand -base64 1024 > random

A) create Windows/Linux compatible encrypted container with minimal prompts:
cd;veracrypt enc --text --create --verbose --pim=0 --keyfiles= --volume-type=normal --filesystem=ntfs --encryption=AES --hash=SHA-512 --random-source=random
B) create container, but let me choose all parameters:
cd;veracrypt enc --text --create -v --random-source=random
example answers:
6 (NTFS for compatibility with Windows?)
secure non disctionary password
Enter (empty input on PIM)
Enter (no keyfile)

rm random;mkdir dec
Mount volume:
veracrypt --pim=0 --keyfiles= --protect-hidden=no -m nokernelcrypto enc dec

List volumes:
df -h;veracrypt -l

Dismount all volumes:
veracrypt -d

Veracrypt parameters:
veracrypt -h|head
Creating shortcut/command "dec" to decrypt container and "enc" to encrypt (dismount):
echo -e "alias dec="veracrypt --pim=0 --keyfiles= --protect-hidden=no -m nokernelcrypto /home/YOU/enc /home/YOU/dec"" >> ~/.bashrc;echo -e "alias enc="veracrypt -d"" >> ~/.bashrc

Regarding "nokernelcrypto" mount parameter, i selected it, because it gives impression that it allows better performance handling many tiny files.

Installing Tor on Raspbian 10 Buster

(some commands are multi-liners)
sudo su
echo -e "deb buster main\ndeb-src buster main" >> /etc/apt/sources.list
curl | gpg --import;gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
apt update;apt install tor tor-arm
grep -c "User debian-tor" /usr/share/tor/tor-service-defaults-torrc;echo "You should see 1. Else, there may be some problem."
I wanted to route certain web browser traffic or all computer traffic thru the Tor network. I did it via polipo (somehow it not worked without it) as described below, but under are also links to other methods

sudo apt install polipo;
echo -e "logSyslog = false\nlogFile = /var/log/polipo/polipo.log\nallowedClients =,\nsocksParentProxy = localhost:9050\nsocksProxyType = socks5\nproxyAddress =\nproxyPort = 8080\ndiskCacheRoot =" > /etc/polipo/config;
service tor restart;service polipo restart
Then you can use Tor either in web browser only or everywhere.

A) Tor in one web browser only: i install Firefox: apt install firefox-esr
Go to Firefox Settings, Proxy, set manual proxy, type http, IP is and port 8080, tick to use for all protocols, tick to proxy DNS. check if you no longer have local internet IP.

B) Tor for all internet activity (i do not believe UDP will go thru it?), following will do it for all users:
sudo su
echo -e "http_proxy=\nhttps_proxy=\nsocks_proxy=socks5://" >> /etc/environment
logout user and login back. command line, browsers should use tor as a proxy thanks to polipo that does http thru Tor's socks. To revert this (not proxify the traffic), run: unset http_proxy;unset https_proxy;unset socks_proxy

Above mentioned process is not ideal i am sure. It likely sends even the requests to localhost via Tor which is wrong and may end in failures to access localhost services from localhost and flood log files like /var/log/syslog with errors, thus logSyslog set to false in polipo conf. Also i do not trust this method is bulletproof in preventing leaking traffic outside Tor and also have doubts about which private data will be sent unencrypted and revealed to the possibly malicious Tor exit node. If you know better approach to use Tor as a proxy, please kindly share. [This script]( contains some interesting iptables rules for tor killswitch, but it not worked for me somehow.

other tutorials (not tried) for a Tor as a system proxy:
A) (readme install sh fix, works on Deb. with amd64 arch.)
B) (basicaly just iptables rules, PORT variable missing " and XXX replace by "debian-tor" likely)
C) (Arch based OS, python3)
TIP: (install Tor on RaspberryPi)
D) <--------------------