Recent Posts

Featured image for Configuring Samba Share in Linux

Configuring Samba Share in Linux

Samba is a widely-used software suite that enables file and printer sharing between Windows and Linux systems. The primary configuration file for Samba is typically located at /etc/samba/smb.conf. This article will guide you through setting up a Samba share on Linux, utilizing the provided information.

Samba Configuration Path

The main configuration file for Samba is usually located at /etc/samba/smb.conf. This file contains various settings that control the behavior of Samba, including share definitions, authentication settings, and access controls.

Featured image for Adding a Non-Root User to Execute Docker Commands

Adding a Non-Root User to Execute Docker Commands

In Docker, it’s common to want non-root users to execute Docker commands without needing to use sudo each time. This is achieved by adding the user to the docker group. Here are the steps to do that:

  1. Open a Terminal: First, open a terminal on your Linux system.

  2. Check If the docker Group Exists: Run the following command to check if the docker group already exists:

    bash
    1
    
    cat /etc/group | grep docker

    If it doesn’t exist, you will not see any output from this command.

  3. Create the docker Group (if necessary): If the docker group doesn’t exist, you can create it using the following command:

    bash
    1
    
    sudo groupadd docker
  4. Add the User to the docker Group: To add the user john to the docker group, use the usermod command with the -aG option:

    bash
    1
    
    sudo usermod -aG docker john

    This command appends (-a) the user john to the docker group (-G).

  5. Verify the User’s Group Membership: To confirm that the user john has been added to the docker group, you can use the id command:

    bash
    1
    
    id john

    You should see docker listed among the user’s groups.

  6. Log Out and Log Back In: For the changes to take effect, it’s recommended to log out and log back in as the user john. This ensures that the group membership is updated.

  7. Test Docker Access: After logging back in, you can test if john can run Docker commands without sudo. For example:

    bash
    1
    
    docker --version

    If you see the Docker version information without any permission errors, then john now has the necessary permissions to use Docker without sudo.

Featured image for How to Fix Chrome Certificate HSTS Issue

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:

    Code
    chrome://net-internals/#hsts
  3. In the “Delete domain” section, you will see a text field.

  4. Type the domain name of the website for which you are encountering the HSTS issue into the text field. For example, if you are having problems with “example.com,” type “example.com” (without quotes).

  5. After typing the domain name, click the “Delete” button. This action will remove the HSTS settings for the specified domain.

  6. Now, in the “Query domain” section, you will find another text field.

  7. Type the same domain name that you just removed in the previous step into this text field.

  8. After typing the domain name, click the “Query” button.

  9. If the HSTS settings have been successfully removed, your response should be “Not found.” This indicates that the HSTS entry for the domain has been deleted, and Chrome will no longer enforce HTTPS for that website.

Featured image for Login to any user as root

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.

  3. su -s /bin/bash www-data: This command attempts to switch to the www-data user, using the -s flag to specify the shell (in this case, /bin/bash). This is usually done to execute commands as the www-data user.

Featured image for Location of Cron Logs on Ubuntu 14.04

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:

    bash
    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:

    plaintext
    1
    
    #cron.* /var/log/cron.log
  3. Save the file and exit the text editor.

  4. Restart the rsyslog service to apply the changes:

    bash
    1
    
    sudo service rsyslog restart
  5. Restart the cron daemon to ensure it starts writing messages to the new log file:

    bash
    1
    
    sudo service cron restart