Monday, June 27, 2022

Make ssh servers work on Bitnami Debian VMs

Bitnami provides VM and cloud images of popular software that can be used to deliver services or solutions. They are easy to get going because they support formats. After installing Apache Guacamole, I needed to connect to the VM's ssh server. Bitnami built their Apache Guacamole on Debian and I found that making it run required a few additional steps. If I tried to start up the ssh server, it would give me this error message. 

Condition check resulted in OpenBSD secure shell server being skipped

The main thing to understand is that access to ssh is not really required. Connections via the host console is enough for simple jobs. The application itself provides a wealth of settings to work with. 

If an ssh access is required, follow the following steps on the host console to make ssh work on the Apache Guacamole Bitnami VM.

  • Connect to the host console. This will depend on how the Bitnami VM was installed and what platform it was installed on. Login into the console using the username and password displayed or the information that was changed the during installation.
  • Once logged in, generate new host keys using this command 
sudo ssh-keygen -A
  • Then make the run directory
sudo mkdir -p /var/run/sshd 
  • Create a link for localtime in the directory
cd /var/run/sshd
sudo ln -s /etc/localtime localtime 
  • Delete the 'lock' file preventing unintentionally running of the SSH server
sudo rm /etc/ssh/ssshd_not_to_be_run
  • Test it with
sudo /usr/bin/sshd -T
If the screen fill with settings information, the SSH server is capable of running.
  • Start the SSH service with
sudo systemctl start ssh
  • Try and login from remote using bitnami credentials

Additional steps my be required to login using key-based login


Wednesday, September 11, 2019

Bareos Client Configuration

Bareos has changed the structure of the configuration files allowing for different sections of the configuration to be isolated in their own files. This improves readability and allows for third-party applications to be written to edit the Bareos configuration. 
If you are new to Bareos or Bareos installation, read the introduction in this article to get more information.
The new way to configure a client is done at the Bareos Client and the Bareos Server. Please take note which host is the following command is executed on.
To create and configure a new Baresos Client,  follow the steps below
1.       Generate a password and copy it somewhere
# < /dev/urandom tr -dc A-Za-z0-9 | head -c32; echo
8wstlW1xkTQmmt1mLdbKjIWSuoSy1F69
2.       Log into the Bareos Server
3.       execute the Bareos Console
# bconsole
4.       Create the client configuration. In this example the client name is prod-server and the IP address is 192.168.0.2. Replace it with the correct IP address and add the password generated above
* configure add client name=prod-server address=192.168.0.2 password=8wstlW1xkTQmmt1mLdbKjIWSuoSy1F69
A sample output is below
*configure add client name=prod-server address=192.168.0.2 password=8wstlW1xkTQmmt1mLdbKjIWSuoSy1F69
Exported resource file "/etc/bareos/bareos-dir-export/client/prod-server/bareos-fd.d/director/bareos-dir.conf":
Director {
 Name = bareos-dir
 Password = "[md5]f7180d44d3cad452f611e2dfdfd3b007"
}
Created resource config file "/etc/bareos/bareos-dir.d/client/prod-server.conf":
Client {
 Name = prod-server
 Address = 192.168.0.2
 Password = 8wstlW1xkTQmmt1mLdbKjIWSuoSy1F69
}
*exit
5.       Restart Bareos Director
# systemctl restart bareos-dir
# systemctl status bareos-dir

The configuration information for the bareos client is the Resource Config File. This must be copied to the Bareos client host in the following steps.

A. On the Bareos server:
The Bareos Client requires information from the Bareos server. The information is in the resource file created when the client configuration was created on the Bareos Server.
Install the configuration for the bareos client using the commands below to copy the configuration file to the bareos client (e.g. prod-server with the IP address 192.168.0.2). On the Bareos Server, from the prompt

# scp /etc/bareos/bareos-dir-export/client/prod-server/bareos-fd.d/director/bareos-dir.conf root@192.168.0.2:/etc/bareos/bareos-fd.d/director/

B. On the Bareos Client
Log into the Bareos Client host (where the Bareos Client is installed), in this example, prod-server (IP 192.168.0.2).
1.       Edit the client configuration file
# cd /etc/bareos/bareos-fd.d/client
# vi myself.conf

2.       Change the Name from localhost to prod-server
Client {
      Name = localhost-fd prod-server
      Maximum Concurrent Jobs = 20

3.       Save the file and test whether this configuration is correct
# bareos-fd –t
The configuration is correct if there are no error messages.

4.       Apply the new configuration by restarting the client.
# systemctl restart bareos-fd
This can be verified with the command 
# systemctl status bareos-fd
Look for the line beginning with " Active " which should say " active (running) ".

Verify on the Bareos server:

# bconsole
* status  client=prod-server
Connecting to Client coders at 192.168.0.2:9102
prod-server Version: 17.2.4 (21 Sep 2017)  x86_64-redhat-linux-gnu redhat CentOS Linux release 7.4.1708 (Core)
Daemon started 09-Jan-19 18:24. Jobs: run=204 running=0.
 Heap: heap=36,864 smbytes=37,990 max_bytes=2,220,893 bufs=227 max_bufs=386
 Sizeof: boffset_t=8 size_t=8 debug=0 trace=0 bwlimit=0kB/s

Wednesday, August 14, 2019

Remove Boxes in Docx files after editing in Google Docs

Google recently introduced improved editing of DOCX or Microsoft Word Document 2007 files. Previously DOCX documents could be edited but need to be saved as Google Doc files or later exported to another format.If it did open DOCX files, the level of compatibility would be roughly equivalent to Libre Office opening a DOCX file.
But recently Google has improved this and made it so that DOCX documents could be saved in the same format. This makes it possible to edit Word files on Android devices without having to use the Microsoft Word Android app. The Word app famously wanted an upgrade to Office365 before it could connect to Google drive in the past. It's possible now but it's a hit or miss affair. It was fine connecting to Dropbox or Box.com and doing it without the upgrade.
But this improvement hasn't been without a cost. DOCX documents saved in Google Docs end up with a Control Box around every paragraph. This first time it happened, it sucked out whatever joy there was of being able to save to DOCX in Google Docs. It was even quite clear what the box around the paragraph was.
But getting rid of it is simple. Select All text and using Ctrl-A.  Then Right-Click on the selected text and from the menu choose "Remove Content Control". The boxes should be removed.
This is a pain when editing and sharing DOCX over Google Drive with someone who is using Microsoft Word to edit the file.
Google Docs get updated from time to time without much fanfare. Hope this will be fixed soon.