Jun 24, 2021

CentOS v.7 : Apache Guacamole

 Apache Guacamole is a RDP to HTTP/HTTPS open source remote broker/gateway.

1. Install CentOS v.7.0 with Minimal Installation, follow all on-screen configurations accordingly.

2. During the install, configure the IP Address to Fixed/Manual and the hostname (eg. guacsvr).

3. Install the RPM Fusion repository :-

  • sudo yum install -y epel-release
  • sudo yum -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
4. Install some utilities :-
  • sudo yum install -y nano net-tools wget

5. Install MariaDB, Tomcat & Apache Guacamole dependencies :-
  • sudo yum install -y cairo-devel libjpeg-turbo-devel libwebsockets-devel libpng-devel uuid-devel ffmpeg-devel freerdp-devel pango-devel libssh2-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel libtool libtelnet-devel freerdp mariadb-server tomcat

6. Download, Extract & Make Apache Guacamole Server (as of writing the latest version is 1.3.0, check for latest version at https://downloads.apache.org/guacamole/) :-
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/source/guacamole-server-1.3.0.tar.gz
  • sudo tar -xzf guacamole-server-1.3.0.tar.gz
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/binary/guacamole-1.3.0.war
  • cd guacamole-server-1.3.0
  • sudo ./configure --with-init-dir=/etc/init.d
  • sudo make install
  • sudo ldconfig && cd ~
  • cp ~/guacamole-1.3.0.war /var/lib/tomcat/webapps/guacamole.war
  • sudo firewall-cmd --permanent --add-port=8080/tcp
  • sudo firewall-cmd --reload
  • sudo systemctl enable tomcat && systemctl enable mariadb && systemctl enable guacd

7. Download & Install Connector, Extensions & Lib :-
  • sudo mkdir -p /usr/share/tomcat/.guacamole/{extensions,lib}
  • sudo wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.24.tar.gz
  • sudo tar -xzf mysql-connector-java-8.0.24.tar.gz
  • cp mysql-connector-java-8.0.24/mysql-connector-java-8.0.24.jar /usr/share/tomcat/.guacamole/lib/
Extensions (select whichever you preferred) :-
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/binary/guacamole-auth-jdbc-1.3.0.tar.gz
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/binary/guacamole-auth-ldap-1.3.0.tar.gz
  • sudo tar -xzf guacamole-auth-jdbc-1.3.0.tar.gz
  • sudo tar -xzf guacamole-auth-ldap-1.3.0.tar.gz
  • cp guacamole-auth-jdbc-1.3.0/mysql/guacamole-auth-jdbc-1.3.0.jar /usr/share/tomcat/.guacamole/extensions/
  • cp guacamole-auth-ldap-1.3.0/guacamole-auth-ldap-1.3.0.jar /usr/share/tomcat/.guacamole/extensions/
  • sudo systemctl start mariadb && systemctl start tomcat

8. To secure MySQL server configurations :-

  • sudo mysql_secure_installation
  • Enter
  • Key-in your new password
  • When prompted = Yes, Yes, Yes, Yes

9. Configure MySQL DB :-
  • sudo mysql -u root -p
  • CREATE DATABASE IF NOT EXISTS guacdb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
  • GRANT SELECT,INSERT,UPDATE,DELETE ON guacdb.* TO 'guacuser'@'localhost' IDENTIFIED BY 'guacpass' WITH GRANT OPTION;
  • flush privileges;
  • quit

10. Install Apache Guacamole Client :-
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/source/guacamole-client-1.3.0.tar.gz
  • sudo tar -xzf guacamole-client-1.3.0.tar.gz
  • sudo cat guacamole-client-1.3.0/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/*.sql | mysql -u root -p guacdb
  • sudo mkdir -p /etc/guacamole
Create and configure guacamole properties :-
  • sudo nano /etc/guacamole/guacamole.properties
    • #MySQL properties
    • mysql-hostname: localhost
    • mysql-port: 3306
    • mysql-database: guacdb
    • mysql-username: guacuser
    • mysql-password: guacpass
    • #Additional settings
    • mysql-default-max-connections-per-user: 0
    • mysql-default-max-group-connections-per-user: 0
  • sudo chmod 0400 /etc/guacamole/guacamole.properties
  • sudo chown tomcat:tomcat /etc/guacamole/guacamole.properties
  • ls -alh /etc/guacamole/
  • ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat/.guacamole/
  • sudo chown tomcat:tomcat /var/lib/tomcat/webapps/guacamole.war

11. Configure Time Zone for MySQL :-
  • sudo nano /etc/my.cnf
    • default-time-zone='+8:00'

12. Configure the Connector :-
  • sudo setsebool -P tomcat_can_network_connect_db on
  • sudo restorecon -R -v /usr/share/tomcat/.guacamole/lib/mysql-connector-java-8.0.24.jar

13. Restart the server.
  • sudo shutdown now -r

14. On another computer, open any internet browser
  • http://[Server IP]:8080/guacamole
  • Username = guacadmin
  • Password = guacadmin
! Important to change the password !


Apr 5, 2021

CentOS v.7 : List Existing User & Login History

To get User Listing.

 [root@server~]# get ent passwd

OR

[root@server~]# less /etc/passwd

OR

[root@server~]# cut -di -f1 /etc/passwd


To get Login History.

[root@server~]# last -120

OR

[root@server~]# cat /var/log/secure         *The "secure" file may have corresponding date.


Jan 29, 2021

Windows 10 : Enabled Edition Selection (Updated : 29-Jan-2021)

 An updated post on how to copy the "ei.cfg" file and make it a bootable ISO image file. The steps are abit longer than previous.

Assuming you already have the Windows 10 ISO image file downloaded from Microsoft website, for tutorial we will be using 1909 64-bit version only.

Also you need to download and install the following tools :

  1. 7Zip
  2. CDBurnerXP (or any preferred ISO burning software)
  3. Microsoft Windows 10 Assessment and Deployment Kit (ADK)
Note : Download the corresponding architecture of your computer (eg. 32-bit or 64-bit).


1. Download & Install Microsoft Windows 10 Assessment and Deployment Kit (ADK).
  • Select and install only --> Deployment Tools.
  • Others can be unselected.

2. Create a temporary working folder.
  • Create a folder --> C:\Win10Mod
  • Create a sub-folder --> C:\Win10Mod\iso

3. Copy ADK command file to temp folder.
  • Copy --> C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe
  • To --> C:\Win10Mod\*.*

4. Use 7Zip to extract the downloaded Win10 ISO file.
  • Extract to --> C:\Win10Mod\iso\*.*

5. Create or Copy the "ei.cfg" file.
  • To create a blank "ei.cfg" file --> Open --> Notepad.
  • And type either of the following configurations as per below screenshot :
  • Save as file --> C:\Win10Mod\iso\sources\ei.cfg
Note : If you have both 32-bit & 64-bit of the ISO, please copy to their corresponding folders (eg. C:\Win10Mod\iso\x86\sources\*.*     AND     C:\Win10Mod\iso\x64\sources\*.*


6. Create new ISO file with ei.cfg
  • Run as admin --> CMD
  • Type --> oscdimg -lWin10Mod -m -o -u2 -udfver102 -bootdata:2#p0,e,bC:\Win10Mod\iso\boot\etfsboot.com#pEF,e,bC:\Win10Mod\iso\efi\microsoft\boot\efisys.bin C:\Win10Mod\iso C:\Win10Mod\Win10_1909_Mod.iso
  • Wait for it to complete.
Note : Modify the path accordingly. You can also change the iso filename as per your preferences.


7. Burn the ISO to DVD.
  • Open --> CDBurnerXP
  • Select --> Burn ISO image
  • Browse for the new ISO file --> C:\Win10Mod\Win10_1909_Mod.iso
  • Continue and wait until complete.
Note : You can also use any of your preferred DVD burning tools.


8. Double check the contents.
  • Once completed, you can browse the contents of the DVD for "ei.cfg" file which was copied/created in E:\sources\ei.cfg     OR     E:\x86\sources\ei.cfg     OR     E:\x64\sources\ei.cfg
Note : Assuming [E:] drive is the optical drive.



!!! HAPPY COMPUTING !!!

Dec 24, 2020

CentOS v.7 : Enabled/Disabled GUI at Boot-up

 CentOS v.7.0 : Enabled/Disabled GUI from Boot-up.

Enabled

  1. systemctl get-default
  2. systemctl set-default graphical.target
  3. startx

Disabled
  1. systemctl isolate graphical.target
  2. systemctl set-default multi-user.target

Windows Server 2012 R2 : Azure AD Connect

 A. Ports requirements.

  1. DNS = 53, TCP & UDP
  2. Kerberos = 88, TCP & UDP
  3. MS-RPC = 135, TCP
  4. LDAP = 389, TCP & UDP
  5. LDAP SSL = 636, TCP & UDP
  6. SMB = 445, TCP
  7. HTTPS = 443, TCP
  8. WinRM = 5985, TCP
  9. Azure Service Bus = 5671, TCP
  10. Dynamic Port Range-RPC = 49152 ~ 65535, TCP (Random High RPC Port)
B. Minimum Hardware Requirements.
  1. Objects < 10,000 = 1.6Ghz CPU, 4GB RAM, 70GB HDD.
  2. Objects 10,000 ~ 50,000 = Same as above.
  3. Objects 50,000 ~ 100,000 = 1.6Ghz CPU, 16GB RAM, 100GB HDD.
  4. Objects 100,000 ~ 300,000 = 1.6Ghz CPU, 32GB RAM, 300GB HDD (required a full fledge SQL server).
C. Microsoft .NET Framework 4.5.1
D. Microsoft PowerShell 3.0 (PowerShell's Transcription Group Policy = Disabled).
E. Microsoft Windows Remote Management for ADFS = Enabled (required SSL certificate for ADFS).

Note: Microsoft recommended to install Azure AD Connect on domain joined server and not on a domain controller server.

But after some testing and installation trials, I found out that installation on a domain controller server is far much more easier to configure. Unsure will there be any security issues, but heck its only a test domain.

!!! HAPPY COMPUTING !!!

Oct 2, 2020

VMWare : How To Enabled for Synology Active Backup for Business

 I believe anyone that uses a Synology product will or may be using of their plugin package called "Active Backup for Business". It's a FREE tools for you to do backup for Physical Desktops/Servers, Hyper-V, VMWare ESXi.

But how do you enabled the access from Synology to the ESXi server ? The steps are very simple and straighforward.

1. Login to the ESXi server and enable both the Secure Shell (SSH) and Console Shell services.

2. Next is to shutdown that VM Guest before performing the next step.

3. Still in the ESXi server, Right-Click the VM Guest --> Edit Settings.

4. Goto --> VM Options --> Advanced.

5. Click --> Edit Configurations.

6. Click --> Add Parameters.

7. Type-in the following configurations :

7.1 Parameter = ctkEnabled

7.2 Set the value = true

7.3 Parameter = scsi0:0.ctkEnabled

7.4 Set the value = true

Note : If the VM Guest is using an IDE HDD type then the parameter should be "ide0:0.ctkEnabled" 

Also whenever a new HDD was added to the VM Guest, the device will be assigned either "scsi0:1" or "scsi1:1", this assignment may varies per VM.

8. Now save the configurations and proceed to boot-up the VM.

9. After boot-up, you can double check the configurations by browsing the datastore, a new file will be created "[VM Name]-ctk.vmdk". This file will be used by Synology Active Backup for Business the access and identification of the backup.

As how to configure for the Active Backup for Business it will be for another post, but you can always refer to Synology website for tutorials.


!!! HAPPY COMPUTING !!!


 

 

Sep 30, 2020

Xpenology - Synology DSM 6.1 in PC (Part #2 - Installation)

Now once everything is prepared & ready, let's move to the installation steps. If you're new here, do refer back to Xpenology - Synology DSM 6.1 in PC (Part #1 - Preparation) for start.

A. Prepare the USB Bootloader.
The reason we need 2 x USB Flash Drives is because the first USB drive will be used to save the iso image into it and the second USB drive to save the bootloader into it.

1. Run --> CMD (run as Administrator) --> Type --> Diskpart --> [ENTER].


2. You should have the following screen.



3. Type --> List Disk --> [ENTER].



4. Type --> Select Disk 2 --> [ENTER].



Note : If the USB flash drive is in "Disk 3" then change the numeric value accordingly. Do ensure the selection is the USB flash drive and not your local partition(s) or drive(s). As there's no way to reverse these step. Also ensure the USB flash drive doesn't contains any data in it, as my USB flash drive is a 16GB capacity thus its very easy for me to identify which disk.

5. To verify whether the selection is correct or not, type --> List Disk --> [ENTER] again. You will notice an "*" (asterisk) mark beside the selected disk as shown below.



6. Now type --> Clean --> [ENTER].



Note : There's now way to reverse this step, be very careful you are selecting the correct disk.

7. Next is to type --> Exit --> [ENTER] to exit from the "diskpart" utility.



8. Eject the USB flash drive, let's called this "USB-ISO", next insert the second USB flash drive and repeat from Steps #1 to Steps #7.

9. Let's called the second USB flash drive "Bootloader". Then proceed to close the command prompt window and eject it too. This is for easy references for this tutorial, so when I said "USB-ISO" means its the first USB flash drive and when I said "Bootloader" means its the second USB flash drive.


B. Change the configuration.
Now we need to modify some configuration of the downloaded bootloader file before saving the image into the USB flash drive. Assuming you have installed the "OSFMount" tool prior to this.

1. Run --> OSFMount utility now and you see the screenshot as below.



2. Click --> Mount new button and the following windows will be displayed.



3. Browse for the iso file "DS3615xs 6.1 Jun's Mod V1.02b.img" which you have downloaded.



4. Next you will be prompted to select which partition image, Select --> Partition 0 - 15.0 MB (DOS3.31 + FAT 16) as shown below.



5. Once selected, Untick --> Read-only drive option as shown below. And Click --> OK button to continue.



6. Now the utility will load the image and mount a virtual drive as shown below.



7. Open --> Windows Explorer --> Browse to the virtual drive --> [E:\grub] folder.



8. Locate a file called --> grub.cfg --> Right-Click --> Open with --> Notepad++ (assuming you have installed Notepad++ utility).



9. Now Notepad++ utility will be open the file accordingly as shown below.



10. Locate the following lines as shown below.


11. Leave this screen open for now.


C. Locating the VID and PID Value.
With the "USB-ISO" still plugin, its time to look for the VID & PID value, the simplest way is to use USB tool as you have downloaded earlier. I'm using the "CheckUDisk_v5.4.exe" utility for this.

Note : that not all utilities are created equal thus you may need to explore around which suits your USB flash drive best and have the accurate information.

1. Run --> CheckUDisk utility and the following screen will be displayed.



2. You need to Tick --> All USB Device option then it will shows all available USB devices as shown below.



3. Note down the VID & PID value as shown.


My USB flash drive's VID value is 0781 and the PID value 5567. These values varies and depends on the manufacturer and model.

4. Now you can close this utility.


D. Getting Serial Number.
As I've explained earlier, DSM will not run without a valid Serial Number thus we need to generate a S/N that can be authenticated.

1. Open any internet browser --> https://xpenogen.github.io/serial_generator/index.html, you have a similar webpage displayed as below.



2. Select the appropriate model from the drop-down list and Click --> Generate button. Example I've used DS3615xs model, the S/N is generated at the bottom box (sorry, I've to hide it now). Note down the generated S/N.



3. Proceed to close the browser.


E. Getting NIC's MAC Address.
Next is to get the NIC's MAC address, this can be either found inside the BIOS/UEFI or physically on a label at the NIC.

Assuming its a built-in NIC, the MAC address is usually located inside the BIOS/UEFI under "System Information". I can't exactly tell you where it will be located as each manufacturer may have different naming convention.

I've found mine MAC address is "5C-D9-98-F5-F1-B3", note down the address.


F. Making the changes.
Now its time to return back to the Notepad++ screen, with all the information ready lets make the configurations changes accordingly.

1. Replace the value accordingly, example as per screenshot below.



Note : I've leave the "0x" value intact and only replace the rear value with correct value of my USB flash drive.

Note : The MAC address must not contains any special characters, it must be remove.

2. You may also wanted to change the timeout value to "3" seconds as shown below. This is optional but its good slow things down a bit.



3. Click --> "Save" icon as shown below and close the Notepad++ utility.



4. Next is to unmount the virtual drive, Click --> Dismount All & Exit button.



5. Next is to launch "Rufus" utility, my version is v.3.4.1430 (as of writing), you may have the latest version downloaded.



6. Click --> SELECT button, browse for "DS3615xs 6.1 Jun's Mod V1.02b.img" file, example screenshot of the selected file as shown below.


Note : Ensure the correct USB drive is selected, mine is a 16GB USB flash drive thus its easily identified.

7. Click --> START button and when prompted, Click --> OK button to start the writing process.



8. This may take a while, go have some coffee.



9. Once completed, you will see the following status screen.



10. Proceed to close "Rufus" utility then eject the "USB-ISO" flash drive from the computer.

11. Plugin both the "Bootloader" and "USB-ISO" flash drive into the old computer.

12. You may need to configure the old computer's BIOS\UEFI to boot from USB drive, mine I have to press [F10] key during power-on to invoke the boot menu option and select the "USB-ISO" flash drive to boot. Your computer may be using a different key.

13. Also while in the BIOS/UEFI screen, look for "C1E Support" or similar wording. If applicable this option must be DISABLED prior to booting the USB drive.

14. After successfully booted from the USB drive, you will the following screen, give it another 3-5 minutes before proceeding to the next step.



15. Now back to your computer, browse, download and install the "Synology Assistant" tool. This tool is important to find the Xpenology unit in the network and in the installation steps. If detected successfully, you should see the following screen as below. Select the unit and click "Connect" button.


16. You will have the following screen displayed. Click "Setup" button to continue.


17. At this stage, select "Manual Install" option. DO NOT CLICK "Install Now" button.


18. At this screen, click "Browse" button and browse your local computer where the .pat file was downloaded previously. It can be downloaded at (https://www.synology.com/en-global/support/download/DS3615xs#firmware).



19. Once selected, click "Install Now" button to continue.


20. You will be prompted with this warning message, just select the option and click "OK" button to continue.


21. The progress bar will be displayed and depending on your hardware configurations the completion time may differs. Please wait for it to complete.


22. Once completed, you will be prompted to input the following information. You may put in whatever name and password you desired. Click "Next" button when ready.


23. Next is select "Download DSM updates and install them manually" option. This is to ensure that Xpenology will be updated automatically as the updates will BRICK the system and as such it is recommended to disabled the auto updates accordingly. Click "Next" button when ready.


24. At this screen, you need to click "Skip this step" option. It is located just below the "Next" button and its GREYED OUT. Please look carefully. If you setup the QuickConnect function, some forumers mentioned it may brick your Xpenology unit too, though I did not try thus unsure how true.


25. Ignore the message and just click "Yes" button to continue.


26. DO NOT select any option at this screen, just click "Go" button to continue.


27. Since this is Xpenology, you need to also select "Skip" option located on the top-right corner.


28. Once everything is done, you should be presented with the DSM Desktop screen as shown below. You may now proceed to configure the unit such as changing the to fixed IP address, creating Volume(s), installing package(s) etc.


The following steps is OPTIONAL but recommended if you want to have SHR (Synology Hybrid RAID) enabled. There are many benefits in enabling this option, you can Google the comparison of SHR vs RAID 5.

29. Open "Putty" application, if not available it can be downloaded here (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html). Type in the appropriate IP address of your Xpenology unit and connect to it. Ensure also that SSH is enabled on port 22.

30. At the command prompt type in the following :

30.1 sudo su
30.2 sudo -i vi /etc.defaults/synoinfo.conf

31. Inside the file, browse and look for "supportraidgroup="yes"" , it is found at Line 294,2. Once located you need to comment it out by adding "#" in front of the configuration. You may need to press the [INSERT] key in order to this.

32. Next is to insert a line just below the configuration, type in --> support_syno_hybrid_raid="yes", and when done just press the [ESC] key. Refer below screen for example.




33. Now press " : " key, and type "wq" and press [ENTER] key. This will save the changes.

34. Next is to exit putty and reboot the xpenology. Once booted up you can now have the options to create SHR Volume.

That's all and hope you'll enjoy playing with it. But I would strongly recommend to buy original unit from Synology if you are using it for business and their support.

!!! HAPPY COMPUTING !!!