When connecting to Ubuntu 20.04 server using SSH from a Mac computer, get an error
kex_exchange_identification: read: Connection reset by peer
On checking the servers log file (/var/log/auth.log), found the following error message
Jul 23 06:53:34 server sshd[24147]: Unable to negotiate with 17.19.44.24 port 47280: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 [preauth]
To install LAMP (Apache, MySQL, PHP) on Ubuntu/Debian web server, run
apt-get install lamp-server^
This use meta package install LAMP. If you want to remove, don’t remove the meta package as it will remove many other required packages. You need to remove packages one by one.
On my computer running Ubuntu 18.04, MriaDB stopped working. PHP application i run on my computer failed with error
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ok_test.feeds' doesn't exist (SQL: select * from `feeds` where `processed` = 0)
Application can’t find the table. So i tried to login to MySQL and see if table is there or not. But i get error
boby@sok-01:~$ mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2504
Server version: 10.2.30-MariaDB-1:10.2.30+maria~bionic-log mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
ERROR 1018 (HY000): Can't read dir of '.' (errno: 24 "Too many open files")
MariaDB [(none)]>
Next i checked if this is due to any MySQL upgrade. I found MySQL got updated today
root@sok-01:~# grep mariadb /var/log/dpkg.log
2019-12-13 08:02:46 status triggers-pending mariadb-server-10.2:amd64 1:10.2.29+maria~bionic
2019-12-13 08:02:46 upgrade mariadb-common:all 1:10.2.29+maria~bionic 1:10.2.30+maria~bionic
2019-12-13 08:02:46 status half-configured mariadb-common:all 1:10.2.29+maria~bionic
2019-12-13 08:02:46 status unpacked mariadb-common:all 1:10.2.29+maria~bionic
2019-12-13 08:02:46 status half-installed mariadb-common:all 1:10.2.29+maria~bionic
To fix this error, run
systemctl edit mysql
This wil open a text editor. Add following
[Service]
LimitNOFILE=8192
Save and quit the editor. Restart MaraDB with
systemctl restart mysql
MySQL will work properly now. systemctl edit mysql will create file /etc/systemd/system/mysql.service.d/override.conf
XFCE is a lightweight Desktop Environment for Linux. XFCE + vnc allows you to set up a remote desktop on a VPS or dedicated server located in a remote data center or cloud. You can connect to remote desktop using a VNC client and work like it is a local computer, similar to Windows Remote Desktop (RDP).
To install XFCE run
apt install -y xfce4 xfce4-goodies
You will be asked to select Default Display Manager. You can select any of the options.
Next install vncserver
apt install tightvncserver autocutsel
It is a bad idea to use root user for logging into the desktop. Create a normal user with sudo privileges to be used as desktop user.
useradd -m -s /bin/bash USERNAME
It will be good to make this user an admin, so the user can install software or update the system.