Dimas Maulana

Dimas Maulana

Developer

Welcome to my website! I am a developer with a current focus on React and Go. My experience encompasses both front-end and back-end development, enabling me to design and develop seamless and efficient applications.

How to Fix Chrome Certificate HSTS Issue

If you are encountering an issue with Chrome’s HSTS (HTTP Strict Transport Security) certificate for a specific website, you can follow these steps to resolve it. HSTS is a security feature that enforces HTTPS connections for websites, and sometimes it can lead to certificate errors. Here’s a step-by-step guide on how to fix it:

  1. Open Google Chrome and go to the address bar.

  2. Type the following URL and press Enter:

Login to Any User as Root

It looks like you’re trying to log in as the root user and then switch to another user, www-data, with the su command in a Unix-like operating system. Here’s a breakdown of what’s happening in your provided commands:

  1. $ su: This command is used to switch to another user account. When executed without specifying a username, it assumes you want to switch to the root user.

  2. Password:: You’ll be prompted to enter the root user’s password. You should enter the root password to proceed.

How to Port Forward Docker-Machine to Localhost

Port forwarding allows you to expose services running inside a virtual machine, such as Docker-Machine, to your local machine. In this example, we’ll use VirtualBox and Docker-Machine to forward port 8080 from the virtual machine to localhost.

Prerequisites

Before you begin, make sure you have the following:

Location of Cron Logs on Ubuntu 14.04

Cron logs on Ubuntu 14.04 are typically stored in the /var/log/syslog file. However, if you wish to separate cron-related logs into their own file, you can follow the steps you’ve provided to create a dedicated log file for cron messages. Here’s how you can do it:

  1. Open the 50-default.conf file in the /etc/rsyslog.d/ directory:

    1
    2
    
    cd /etc/rsyslog.d/
    sudo nano 50-default.conf
  2. Uncomment the line that corresponds to cron messages. Remove the “#” symbol at the beginning of the line:

Viewing All Git Diffs With Vimdiff

If you’re a developer using Git for version control and you’re looking for a powerful way to visualize the differences between different versions of your code, Vimdiff is a handy tool to have in your toolkit. Vimdiff is a feature-rich text editor that comes with built-in support for comparing and highlighting differences between files, making it an ideal choice for inspecting code changes. In this article, we’ll explore how to set up Vimdiff as a diff tool for Git and how to make the most of its features for effective code comparison.

Troubleshooting SSHD Connection Issues With Public Key in Cygwin

Cygwin provides a Unix-like environment for Windows, including an implementation of OpenSSH, which allows you to establish secure remote connections using the SSH (Secure Shell) protocol. However, connecting to Cygwin’s SSH server (sshd) using public key authentication can sometimes present challenges. This blog post will guide you through a troubleshooting process to resolve issues related to connecting to Cygwin sshd with public key authentication.

Step 1: Update /etc/sshd_config

  1. Open the Cygwin terminal and navigate to the Cygwin installation directory (typically C:\cygwin64 or C:\cygwin).
  2. Locate the “sshd_config” file in the etc directory. The full path should be something like C:\cygwin64\etc\sshd_config.
  3. Open the “sshd_config” file using a text editor (e.g., Notepad++).
  4. Look for the “StrictModes” option and set it to “no.” This allows more relaxed permission checking for the authorized_keys file.
  5. Save the changes and close the text editor.

Step 2: Generate SSH Key Pair

  1. If you haven’t already done so, generate an SSH key pair on the client machine using the “ssh-keygen” command. Make sure to choose a strong passphrase to protect your private key.
  2. By default, the key pair will be saved in the “.ssh” directory in the user’s home directory (e.g., C:\Users\YourUsername.ssh).

Step 3: Copy Public Key to Cygwin Server

  1. In the Cygwin terminal, navigate to the user’s home directory (e.g., cd ~).
  2. Create the “.ssh” directory if it doesn’t exist: mkdir .ssh
  3. Use the “scp” command to copy the public key to the Cygwin server: scp <public_key_file> user@server:/home/user/.ssh/authorized_keys Replace “<public_key_file>” with the path to your public key file. Replace “user” with your username on the Cygwin server. Replace “server” with the hostname or IP address of the Cygwin server.

Step 4: Restart SSHD Service

  1. In the Cygwin terminal, run the following command to restart the sshd service: net stop sshd && net start sshd

Step 5: Test SSH Connection

  1. On the client machine, open a new terminal or command prompt.
  2. Run the following command to connect to the Cygwin server using SSH: ssh user@server Replace “user” with your username on the Cygwin server. Replace “server” with the hostname or IP address of the Cygwin server.
  3. If the connection is successful and prompts for the passphrase, enter the passphrase associated with your private key.

Conclusion

By following the troubleshooting steps outlined in this blog post, you should be able to connect to the Cygwin sshd server using public key authentication. Remember to ensure that the “StrictModes” option in the sshd_config file is set to “no” to allow more flexible permission checking for the authorized_keys file. Generating an SSH key pair, copying the public key to the Cygwin server, and restarting the sshd service are critical steps in establishing a successful SSH connection.

0%