SSH Passwordless Login With Keychain
Install Keychain
dnf install keychain -y
# apt-get install keychain -y
# pkg install keychain -y
Generate a new ssh key if not exist
ssh-keygen -t ecdsa-sha2-nistp256 -C $USERNAME -f ~/.ssh/$USERNAME
Assign the pass phrase when prompted.
How to use Keychain
Update your $HOME/.bash_profile file or simular initialization file for zsh, fish, etc.
vi $HOME/.bash_profile
Append the following code:
alias sshkey_secured="keychain $USERNAME --nogui --quiet --timeout 60 ; source ~/.keychain/$HOSTNAME-sh"
source ~/.keychain/$HOSTNAME-sh
Run once in the same terminal to update environment:
…install selfhosted internal mailinator
Setup domain
- Log in https://my.freenom.com/
- buy yourdomain.here for $0/year
- set glue records:
KLEY.yourdomain.here - xxx.yyy.zzz.abc YELK.yourdomain.here - xxx.yyy.zzz.abc - Use custom nameservers:
KLEY.yourdomain.here YELK.yourdomain.here
Setup DNS service
sudo -i
dnf install bind bind-utils
cat > /etc/named.conf << TOLIK
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { none; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
secroots-file "/var/named/data/named.secroots";
recursing-file "/var/named/data/named.recursing";
recursion no;
dnssec-enable no;
dnssec-validation no;
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
include "/etc/crypto-policies/back-ends/bind.config";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
zone "yourdomain.here" {
type master;
file "yourdomain.here.hosts";
allow-transfer {
127.0.0.1;
localnets;
};
};
TOLIK
cat > /var/named/yourdomain.here.hosts << TOLIK
\$ttl 38400
@ IN SOA yourdomain.here. root.yourdomain.here. (
1461722457
10800
3600
604800
38400 )
yourdomain.here. IN A xxx.yyy.zzz.abc
kley.yourdomain.here. IN A xxx.yyy.zzz.abc
yelk.yourdomain.here. IN A xxx.yyy.zzz.abc
yourdomain.here. IN MX 5 yourdomain.here.
@ IN NS kley.yourdomain.here.
@ IN NS yelk.yourdomain.here.
TOLIK
named-checkconf /etc/named.conf
named-checkzone yourdomain.here /var/named/yourdomain.here.hosts
# zone yourdomain.here/IN: loaded serial 1461722457
# OK
Setup MAIL service
mkdir /srv/inbucket
chown daemon:daemon /srv/inbucket
dnf install -y https://github.com/inbucket/inbucket/releases/download/v3.0.0-beta3/inbucket_3.0.0-beta3_linux_amd64.rpm
mkdir /etc/systemd/system/inbucket.service.d/
cat > /etc/systemd/system/inbucket.service.d/override.conf << TOLIK
[Service]
Environment=INBUCKET_SMTP_ADDR=0.0.0.0:25
Environment=INBUCKET_SMTP_DOMAIN=yourdomain.here
Environment=INBUCKET_SMTP_MAXRECIPIENTS=2000
Environment=INBUCKET_SMTP_DEFAULTACCEPT=false
Environment=INBUCKET_SMTP_ACCEPTDOMAINS=yourdomain.here
Environment=INBUCKET_POP3_DOMAIN=yourdomain.here
Environment=INBUCKET_POP3_ADDR=127.0.0.1:1100
Environment=INBUCKET_WEB_ADDR=0.0.0.0:80
Environment=INBUCKET_WEB_MAILBOXPROMPT=@yourdomain.here
Environment=INBUCKET_WEB_MONITORHISTORY=1000
Environment=INBUCKET_STORAGE_TYPE=file
Environment=INBUCKET_STORAGE_PARAMS=path:/srv/inbucket
Environment=INBUCKET_STORAGE_RETENTIONPERIOD="8760h"
Environment=INBUCKET_STORAGE_RETENTIONSLEEP="3600s"
Environment=INBUCKET_STORAGE_MAILBOXMSGCAP="0"
NonBlocking=true
NoNewPrivileges=yes
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
LimitNOFILE=500000
LimitNPROC=500000
TOLIK
systemctl start inbucket
systemctl status inbucket
systemctl enable inbucket
google-chrome: clean passwords
Run google-chrome with –password-store=basic (example)
dnf install sqliteman
cp ~/.config/google-chrome/Default/Web\ Data{,.bak}
sqliteman ~/.config/google-chrome/Default/Web\ Data
install MediaWiki and update with git pull
Install:
cd ~/public_html
git clone https://gerrit.wikimedia.org/r/mediawiki/core.git .
git clone https://gerrit.wikimedia.org/r/mediawiki/vendor.git
cd ~/public_html/skins/
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/CologneBlue
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Modern
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/MonoBook
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/VectorV2
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Vector
Update:
for i in `find ~ -type d -name \.git`; do cd `dirname $i` ; git pull ; done
Example:
-sh-4.2$ find . -type d -name \.git
./public_html/skins/CologneBlue/.git
./public_html/skins/Modern/.git
./public_html/skins/VectorV2/.git
./public_html/skins/Vector/.git
./public_html/skins/MonoBook/.git
./public_html/vendor/.git
./public_html/.git
Upgrade DB:shell/opt/rh/rh-php72/root/usr/bin/php maintenance/update.php
test tst 22
…