1. Install packages
sudo aptitude install libreswan network-manager-l2tp network-manager-l2tp-gnome ike-scan
2. Check encryption
sudo service xl2tp stop
ike-scan 10.20.30.40
Starting ike-scan 1.9.4 with 1 hosts (http://www.nta-monitor.com/tools/ike-scan/)
10.20.30.40 Main Mode Handshake returned HDR=(CKY-R=0305c49ff43d987b) SA=(Enc=3DES Hash=SHA1 Auth=PSK Group=2:modp1024 LifeType=Seconds LifeDuration(4)=0x00007080)
3. Add VPN Connection
Layer 2 Tunneling Protocol (L2TP)
Name: My VPN
Gateway: 10.20.30.40
User name: username@domain.com
Password: *****
4. IPsec Settings
[+] Enable IPsec tunnel to L2TP host
[Advanced]
Phase1 Algorithms: 3des-sha1-modp1024
Phase2 Algorithms: 3des-sha1
[OK]
5. Disable xl2tp service
sudo systemctl disable xl2tpd
6. Connect to VPN
7. If not connecting
sudo aptitude purge libreswan sudo aptitude install strongswan
Źródło: https://askubuntu.com/questions/904217/unable-to-connect-l2tp-ipsec-vpn-from-ubuntu-16-04
aptitude install ipmitool
ipmitool user list
ipmitool user set password [id] [password]
https://support.oneidentity.com/kb/261220/reset-the-bmc-ipmi-password
Skrypt robiący kopię 1:1 z danego folderu a różnice zapisuje do osobnego katalogu.
#!/bin/bash rsync -avb --delete --backup-dir=/home/folder_diff/backup_`date +%Y.%m.%d_%H:%M:%S` /home/folder1/ /home/folder2/
https://www.jveweb.net/en/archives/2011/02/using-rsync-and-cron-to-automate-incremental-backups.html
sudo crontab -e
@reboot sh /home/user/test.sh
https://stackoverflow.com/questions/12973777/how-to-run-a-shell-script-at-startup
vim /etc/nftables.conf
...
table inet filter {
set blacklist-v4 {
type ipv4_addr
flags interval
auto-merge
elements = { 185.176.221.167, 81.30.158.0/24, 213.137.128.0/19 }
}
...
# accept traffic originated from us
ct state established,related accept
# drop ip form blacklist
ip saddr @blacklist-v4 drop
....
service nftables restart
https://forum.iredmail.org/topic16335-nftables-rule-no-ping-floods.html
vim /etc/fail2ban/jail.d/postfix.local
action = nftables-multiport[name=postfix, port="80,443,25,587,465,110,995,143,993,4190", protocol=tcp]
banned_db[name=postfix, port="80,443,25,587,465,110,995,143,993,4190", protocol=tcp]
sendmail[name=Postfix, dest=user@domain.com, sender=root]
service fail2ban restart
https://forum.iredmail.org/topic9644-fail2ban-blocked-ips.html
aptitude install msmtp
vim /etc/msmtprc
# Set default values for all following accounts. defaults auth on tls on # Account 1 account account1 host mail.domain.com port 587 from user@domain.com user user@domain.com password userpassword # Set a default account account default : account1 aliases /etc/aliases
vim /etc/aliases
root: root@domain.com username: username@domain.com
ln -s /usr/bin/msmtp /usr/sbin/sendmail
Test w CRON
crontab -e
* * * * * echo "A message from Cron"
albo
crontab -e
* * * * * /scripts/backup.sh 2>&1 | msmtp youremail@provider.com
aptitude install cifs-utils
mkdir /mnt/win_share
sudo mount -t cifs -o username=<win_share_user>,password=<win_share_password> //WIN_SHARE_IP/<share_name> /mnt/win_share -o vers=1.0
https://linuxize.com/post/how-to-mount-cifs-windows-share-on-linux/
vim /etc/ssh/sshd_config
Port 1234
vim /etc/nftables.conf
chain input {
...
tcp dport 1234 accept
...
}
services nftables restart services sshd restart
cd /root/iRedMail-1.3.1/tools/
bash create_mail_user_SQL.sh username@domain.com 'Test123' > username.sql
mysql -u dbuser -pdbpass -h localhost vmail < username.sql
zmień folder /var/vmail na taki jaki był wprowadzony przy instalacji
https://docs.iredmail.org/sql.create.mail.user.html
1. Installation.
https://imapsync.lamiral.info/INSTALL.d/INSTALL.Debian.txt
aptitude install libauthen-ntlm-perl libcgi-pm-perl libcrypt-openssl-rsa-perl libdata-uniqid-perl libencode-imaputf7-perl libfile-copy-recursive-perl libfile-tail-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libhtml-parser-perl libjson-webtoken-perl libmail-imapclient-perl libparse-recdescent-perl libmodule-scandeps-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-mockobject-perl libtest-pod-perl libunicode-string-perl liburi-perl libwww-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus
cd /home/username/
wget -c https://imapsync.lamiral.info/dist2/imapsync-1.977.tgz
tar -xf imapsync-1.977.tgz
cd imapsync-1.977
2. Usage
https://imapsync.lamiral.info/#DOC_BASIC_UNIX
User login
./imapsync --host1 mail.host.pl --user1 user1@host.pl --password1 "sicret_pass" --host2 mail.host2.pl --user2 user1@host2.pl --password2 "sicret_pass2"
Master User login
./imapsync --host1 mail.host.pl --user1 "user1@host.pl*masteruser_login" --password1 "masteruser_pass" --host2 mail.host2.pl --user2 "user1@host2.pl*masteruser2_login" --password2 "masteruser_pass2"
3. Import credentials from CSV
vim sync_loop_unix.sh
echo Looping on account credentials found in file.txt
echo
{ while IFS=';' read h1 u1 p1 h2 u2 p2 fake
do
{ echo "$h1" | tr -d '\r' | egrep '^#|^ *$' ; } > /dev/null && continue # this skip commented lines in file.txt
echo "==== Starting imapsync from host1 $h1 user1 $u1 to host2 $h2 user2 $u2 ===="
./imapsync --notls1 --host1 "$h1" --user1 "$u1" --password1 "$p1" \
--host2 "$h2" --user2 "$u2" --password2 "$p2" \
"$@"
echo "==== Ended imapsync from host1 $h1 user1 $u1 to host2 $h2 user2 $u2 ===="
echo
done
} < file.txt
vim file.txt
mail.host.pl;user1@host.pl*masteruser_login;masteruser_pass;mail.host2.p;user1@host2.pl*masteruser2_login;masteruser_pass2 mail.host.pl;user2@host.pl*masteruser_login;masteruser_pass;mail.host2.p;user2@host2.pl*masteruser2_login;masteruser_pass2
chmod +x sync_loop_unix.sh
./sync_loop_unix.sh
https://imapsync.lamiral.info/examples/sync_loop_unix.sh
vim /etc/dovecot/dovecot.conf
auth_master_user_separator = *
passdb {
driver = passwd-file
args = /etc/dovecot/dovecot-master-users
master = yes
}
doveadm pw -s SSHA512
Enter new password:
Retype new password:
{SSHA512}HuxqgaziXpd4pQo17w/De1Opw7fhP6YLFpIBPpzR8AtZPjeEY2ahJruambrCM28CKb3rr4JC6zJbMHLDyjc6b
chmod +w /etc/dovecot/dovecot-master-users
vim /etc/dovecot/dovecot-master-users
username@domain.com:{SSHA512}HuxqgaziXpd4pQo17w/De1Op...
https://imapsync.lamiral.info/FAQ.d/FAQ.Dovecot.txt
https://doc.dovecot.org/configuration_manual/authentication/master_users/
https://doc.dovecot.org/configuration_manual/authentication/authentication_mechanisms/
https://docs.iredmail.org/dovecot.master.user.html
Dovecot 1.2.17
https://www.dovecot.org/list/dovecot/2015-October/102294.html
vim /usr/local/etc/dovecot.conf
passdb passwd-file {
args = /usr/local/etc/dovecot.passwd.masterusers
pass = yes
master = yes
}
vim /usr/local/etc/dovecot.passwd.masterusers
masteruser:{PLAIN}masterpassword cd /root/ wget -c https://domena.com/iRedAdmin-Pro-SQL-4.4.tar.bz2
tar xjf iRedAdmin-Pro-SQL-4.4.tar.bz2 cd iRedAdmin-Pro-SQL-4.4/tools/ bash upgrade_iredadmin.sh
Download latest release of CardDav plugin.
https://plugins.roundcube.net/#/packages/roundcube/carddav
https://packagist.org/packages/roundcube/carddav
https://github.com/blind-coder/rcmcarddav/releases
https://github.com/blind-coder/rcmcarddav/releases/download/v3.0.3/carddav-3.0.3.zip
cd /opt/www/roundcubemail/plugins/ wget -c https://github.com/blind-coder/rcmcarddav/releases/download/v3.0.3/carddav-3.0.3.zip unzip carddav-3.0.3.zip cd carddav cp config.inc.php.dist config.inc.php
vim /opt/www/roundcubemail/config/config.inc.php
// PLUGINS
$config['plugins'] = array('managesieve', 'password','carddav'); https://forum.iredmail.org/topic17082-internal-server-error-iredadmin.html
https://docs.iredmail.org/upgrade.iredapd.html
From the official Ubuntu LostPassword documentation:
1. Reboot your computer.
2. Hold Shift during boot to start GRUB menu.
3. Highlight your image and press E to edit.
4. Find the line starting with "linux" and append rw init=/bin/bash at the end of that line.
5. Press Ctrl + X to boot.
6. Type in passwd username.
7. Set your password.
Źródło: https://askubuntu.com/questions/24006/how-do-i-reset-a-lost-administrative-password
Pobierz sterowniki ze strony Canon na Linux (64 - bit)
MX520 series ScanGear MP Ver. 2.10 for Linux (debian Packagearchive)
MX520 series IJ Printer Driver Ver. 3.90 for Linux (debian Packagearchive)
Rozpakuj pliki:
cnijfilter-mx520series-3.90-1-deb.tar.gz
scangearmp-mx520series-2.10-1-deb.tar.gz
Uruchomi skrypt do instalowania skanera:
cd scangearmp-mx520series-2.10-1-deb ./install.php
Skaner będzie już widoczny w aplikacji Simple Scan lub Scanimage.
Zainstaluj paczki 64bit dla drukarki:
cd cnijfilter-mx520series-3.90-1-deb/ sudo dpkg -i packages/*amd64.deb ./install.sh
0% [Connecting to archive.ubuntu.com(2001:67c:1360:8c01::1a)]
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
0 means its enabled
1 means its disabled/
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6