How To Fix no matching cipher found. Their offer: aes128-cbc,3des-cbc…

When trying to SSH to older devices like a Ubiquiti Bullet2, you may receive an error saying

no matching cipher found. Their offer: aes128-cbc,3des-cbc,aes256-cbc,twofish256-cbc,twofish-cbc,twofish128-cbc,blowfish-cbc

The work around is to manually specify the cipher with the “-c” option. You will also probably need to specify the KexAlgorithm “Key Exchange Algorithm”

ssh -c aes128-cbc -oKexAlgorithms=+diffie-hellman-group1-sha1 admin@192.168.1.20

You can see what ciphers SSH supports by running “ssh -Q cipher”

Example output

ssh -Q cipher
3des-cbc
aes128-cbc
aes192-cbc
aes256-cbc
rijndael-cbc@lysator.liu.se
aes128-ctr
aes192-ctr
aes256-ctr
aes128-gcm@openssh.com
aes256-gcm@openssh.com
chacha20-poly1305@openssh.com

More information
https://www.openssh.com/legacy.html

LibreOffice Calc – Turn page breaks on and off

Turning the Page break option on in LibreOffice Calc will show a dotted line in your Calc spreadsheet to show you if you printed it out where the boundaries would be.

Example showing page breaks in LibeOffice Calc. The dotted lines are the page outline

You can turn this behavior on or off by going to
Tools -> Options -> LibreOffice Calc -> View -> Visual Aids -> Page breaks
And turning the check box on or off

Example of Page breaks being on.

Ubiquiti set DHCP from command line

Edit the “/tmp/system.cfg”

Change the line that contains “dhcpc.status=disabled” to

dhcpc.status=enabled

add the following lines

dhcpc.1.devname=br0         
dhcpc.1.fallback=192.168.1.20
dhcpc.1.fallback_netmask=255.255.255.0
dhcpc.1.status=enabled

Save and exit and save changes

/usr/etc/rc.d/rc.softrestart save

Log into the GUI and verify everything looks correct. Under the network tab it was still showing that it had a static address, although it pulled a DHCP IP.

Linux, Send USR1 signal to pid

In Linux you can send signals to a process id to trigger actions for the program. Useful scenario for this is to renew an IP address on a device that uses udhcpc. You should be able to change udhcpc for other programs, you’ll just need to read the help for that specific program.

In the udhcpc help it says

Signals:
         USR1    Renew lease
         USR2    Release lease

But how do we send those signals to udhcpc? Answer, use the kill command.

kill: kill [-s sigspec | -n signum | -sigspec] pid | jobspec … or kill -l [sigspec]
     Send a signal to a job.

Send the processes identified by PID or JOBSPEC the signal named by SIGSPEC or SIGNUM.  If neither SIGSPEC nor SIGNUM is present, then SIGTERM is assumed. 

Options:   
-s sig    SIG is a signal name   
-n sig    SIG is a signal number   
-l        list the signal names; if arguments follow `-l' they are             
          assumed to be signal numbers for which names should be listed   
-L        synonym for -l 

Kill is a shell builtin for two reasons: it allows job IDs to be used instead of process IDs, and allows processes to be killed if the limit on processes that you can create is reached.
Exit Status:
Returns success unless an invalid option is given or an error occurs. 

We see from above that we can pass a signal name in using the -s option.

So to send USR1 signal to udhcp we do the following

kill -s USR1 pid_of_udhcpc

Replace pid_of_udhcpc with the actual pid or use the following command to find the pid

kill -s USR1 $(pgrep udhcpc)

“pgrep udhcpc” prints the pid of the searched for process.

Helpful links
https://www.thegeekstuff.com/2011/02/send-signal-to-process/
https://www.linux.org/threads/kill-signals-and-commands-revised.11625/

Install Microsoft Teams Preview on Linux

Download the correct package for your distribution of Linux from
https://teams.microsoft.com/downloads

You should be able to open the installer and it should install, if not you can run the following commands from a terminal

The install instructions are for Debian/Ubuntu/Linux Mint.

Install using dpkg

sudo dpkg -i Downloads/teams_1.2.00.32451_amd64.deb

Launch Teams by typing

teams

Or you can launch it from your Applications Menu

After Teams is installed and launched, sign in to your Microsoft account.

DD show show status of progress

You can have dd show the progress of a write by specifying “status=progress” in the command line arguments.

sudo dd if=Downloads/CentOS-8-x86_64-1905-boot.iso of=/dev/sdb status=progress

Example:

bob@localhost:~$ sudo dd if=Downloads/CentOS-8-x86_64-1905-boot.iso of=/dev/sdb status=progress
559690240 bytes (560 MB, 534 MiB) copied, 96 s, 5.8 MB/s    <-- This is shown while writing.
1093632+0 records in
1093632+0 records out
559939584 bytes (560 MB, 534 MiB) copied, 96.0339 s, 5.8 MB/s

no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

Work around is to use the -o option and specify KexAlgorithms with the correct option.

ssh -o KexAlgorithms=+diffie-hellman-group1-sha1 admin@192.168.11.1

https://unix.stackexchange.com/questions/340844/how-to-enable-diffie-hellman-group1-sha1-key-exchange-on-debian-8-0#340853

List of errors from devices

The following are errors that are returned when trying to ssh to a device.

Cambium 450i PMP Equipment

Unable to negotiate with 192.168.0.1 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1

Find system uptime in Linux

There are a few different ways to find out the system up time in Linux.

cat /proc/uptime

admin@localhost [~]# cat /proc/uptime
 306350.37 2218975.63
admin@localhost [~]#

Taking the above command one step further, we can run it in the date command to see the system start up date.

date  --date="cat /proc/uptime | awk '{print $1}'seconds ago"

uptime command

[admin@localhost ~]$ uptime
  6:25AM  up 2 days,  6:24, 3 users, load averages: 0.00, 0.00, 0.00
[admin@localhost ~]$

w command

[admin@localhost ~]$ w
  6:27AM  up 2 days,  6:25, 2 users, load averages: 0.00, 0.00, 0.00
 USER             TTY      FROM              LOGIN@  IDLE WHAT
 admin       p1       localhost.  6:09AM    13 su (bash)
 admin       p2       localhost.  6:25AM     - w
[admin@localhost ~]$

Reference links

https://www.cyberciti.biz/faq/server-uptime-command-to-find-out-how-long-the-system-has-been-running/

https://sharadchhetri.com/2013/03/18/4-different-commands-to-find-system-uptime-in-linux/