Debian – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Mon, 19 Dec 2022 10:28:59 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 A Step-by-Step Guide to Installing OpenDKIM with Postfix on Ubuntu – Unleash the Power of DKIM! https://tecadmin.net/setup-dkim-with-postfix-on-ubuntu-debian/ https://tecadmin.net/setup-dkim-with-postfix-on-ubuntu-debian/#comments Thu, 01 Dec 2022 12:23:52 +0000 https://tecadmin.net/?p=5434 DKIM or DomainKeys Identified Mail is an authentication protocol used to validate the identity of a sender. It’s an important tool for preventing email spoofing, which is when a person impersonates another user and sends emails with their name and address. DKIM Key works by using an OpenDKIM or Domain Key to sign each message [...]

The post A Step-by-Step Guide to Installing OpenDKIM with Postfix on Ubuntu – Unleash the Power of DKIM! appeared first on TecAdmin.

]]>
DKIM or DomainKeys Identified Mail is an authentication protocol used to validate the identity of a sender. It’s an important tool for preventing email spoofing, which is when a person impersonates another user and sends emails with their name and address. DKIM Key works by using an OpenDKIM or Domain Key to sign each message sent. The key is an encrypted string of characters unique to the sender and is used to verify the message comes from the sender’s domain. This makes it harder for malicious actors to send forged messages. DKIM Key also allows receivers to reject messages that fail authentication. This provides added protection against spoofing and other email-based attacks. It’s a crucial safety measure for any email server and one that can help protect your business and its customers.

This tutorial will provide you with a quick and easy way to setup DKIM (DomainKeys) with the Postfix Mail server running on Ubuntu and Debian-based systems.

Setup DKIM (Domain Keys) with Postfix

Prerequisites

Before we install and configure OpenDKIM for Postfix, we need to make sure that we have the necessary prerequisites in place.

  • First and foremost, you will need a working Ubuntu system with root access.
  • You will also need to have Postfix installed and configured.
  • The last prerequisite is that you should have a valid domain name with DNS access.

Without these prerequisites in place, you will not be able to install and configure OpenDKIM on your server.

Step 1: Install Opendkim Package

Once you have all the prerequisites in place, you can start installing OpenDKIM. We will be using the apt package manager to install OpenDKIM on Ubuntu. To install OpenDKIM, you will need to run the following command:

sudo apt update 
sudo apt install opendkim opendkim-tools 

Then add the postfix user to the opendkim group.

sudo usermod -G opendkim postfix

Step 2: Generate Public and Private DKIM Keys

The next step is to create a proper directory structure to keep the Key files secure. Run the following commands to create a directory and set permissions.

sudo mkdir -p /etc/opendkim/keys 
sudo chown -R opendkim:opendkim /etc/opendkim
sudo chmod  744 /etc/opendkim/keys 

Now, generate your public and private DKIM keys using opendkim-genkey command line utility. All the commands are using “example.com” as a domain name. Replace it with your real domain name. We also need to choose a selector name, This can be any unique string, that helps Mail servers to identify the correct DKIM key from the DNS record. Below command will use default as selector key:

sudo mkdir /etc/opendkim/keys/example.com 
sudo opendkim-genkey -b 2048 -d example.com -D /etc/opendkim/keys/example.com -s default -v 

This command will generate a public and private key pair for you. The private key will be stored in the file “selector.private”, and the public key will be stored in the file “selector.txt”. In our case, The filenames are “default.private” and “default.txt”.

Once you have generated the keys, you will need to set appropriate permissions on the private key file:

sudo chown opendkim:opendkim /etc/opendkim/keys/example.com/default.private

Step 3: Setup DKIM Keys to Your DNS Record

Once you have generated the public and private DKIM keys, you will need to add them to your DNS record. To do this, you will need to add the TXT record to your DNS zone file. This record detail can be found under the default.txt file, generate with the private key:

sudo cat /etc/opendkim/keys/example.com/default.txt

You will see the output below:

default._domainkey      IN      TXT     ( "v=DKIM1; h=sha256; k=rsa; "
          "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwC/i/W8cVs5610MpSw1DmRWr5Dh7979SBpmSBpdzmKxyRr1S8hwapB2wWypouxS1RP3s9eEW9Oek2eKNAySZUvb6vQgUP+EK5sBuNe/bR4yvyc9pH9+eR2qvEmky4xksSNaS34F74ZUshwV1QSn8eG/5lTrxJD5TUv3/AymqsmOyT5ya9ga0smNtz+3yP9zAbMsGysnVFS2EQN"
          "9fIUc3S7tqpN9FJhcZG7DVfqcMNUDP7q+9cbu/i9UoFmRbuQW3em1JSGFnu0IwRfnmgPvH4dwjLL9DzXkC576RusuFiDjXzgOtTn/KOHUJ1MoF/vp52hwi+QZPPRfF3ILZbe/+0wIDAQAB" )  ; ----- DKIM key default for tecadmin.net

Remove all the quotes (“) and blank spaces from the record value, then publish it to the DNS zone. See the below screenshot:

Setup DKIM with Postfix on Ubuntu

You can verify the DNS record by running the following command.

sudo opendkim-testkey -d example.com -s default -vvv 

Configure OpenDKIM with Postfix on Ubuntu

Step 4: Confiugring OpenDKIM

Once OpenDKIM has been installed and you have generated the DKIM public-private keys. you will need to configure it. To do this, you will need to edit the configuration file located at /etc/opendkim.conf. In this file, you will need to set the following parameters:

  1. Edit the main configuration file in your favorite text editor:
    sudo nano /etc/opendkim.conf 
    
  2. Uncomment these values and configure as below:
    Syslog                  	yes
    LogWhy                 		yes 
    
    Canonicalization        	relaxed/simple
    Mode                    	sv
    SubDomains              	no
    OversignHeaders         	From
    

    The LogWhy option enables the more detailed logs for troubleshooting:

  3. Now add the following values
    AutoRestart			yes
    AutoRestartRate			10/1M
    Background			yes
    DNSTimeout			5
    SignatureAlgorithm		rsa-sha256
    

    Configure OpenDKIM with Postfix on Ubuntu

  4. Next make sure that UserID is set to opendkim:
    # Remember to add user postfix to group opendkim
    UserID             opendkim
    
  5. Now, append the following entries to the end of the file.
    KeyTable            refile:/etc/opendkim/key.table
    SigningTable        refile:/etc/opendkim/signing.table
    ExternalIgnoreList  /etc/opendkim/trusted.hosts
    InternalHosts       /etc/opendkim/trusted.hosts
    
  6. Save and close /etc/opendkim.conf configuration file.
  7. Now, edit the SigningTable in text editor.
    sudo nano /etc/opendkim/signing.table 
    

    Add the following entries.

    *@example.com    default._domainkey.example.com
    *@*.example.com    default._domainkey.example.com
    

    Save and close the file.

  8. Next, edit the KeyTable file:
    sudo nano /etc/opendkim/key.table 
    

    Add the following entry.

    default._domainkey.example.com     example.com:default:/etc/opendkim/keys/example.com/default.private
    

    Save the file and close it.

  9. Next, edit the trusted.hosts file:
    sudo nano /etc/opendkim/trusted.hosts 
    

    Add your domain name and localhost entries to the newly created file. This tells OpenDKIM that if an email is coming from localhost or from the same domain, then OpenDKIM should only sign the email but ignore the DKIM verification.

    127.0.0.1
    localhost
    
    .example.com
    

    Save and close the file.

  10. Restart OpenDKIM Service
    sudo systemctl restart opendkim 
    

Step 5: Configure Postfix With OpenDKIM

The next step is to configure Postfix to use OpenDKIM.

  1. First we will change OpenDKIM socket file location. Lets create a new directory with the following commands:
    sudo mkdir /var/spool/postfix/opendkim 
    sudo chown opendkim:postfix /var/spool/postfix/opendkim 
    
  2. Now edit the OpenDKIM configuration file in a text editor:
    sudo nano /etc/opendkim.conf 
    

    Search for the Socket entry and update it as following:

    Socket    local:/var/spool/postfix/opendkim/opendkim.sock
    
  3. Next edit the /etc/default/opendkim file:
    sudo nano /etc/default/opendkim 
    

    And set the SOCKET entry as below:

    SOCKET="local:/var/spool/postfix/opendkim/opendkim.sock"
    
  4. Next, you will need to edit the configuration file located at /etc/postfix/main.cf. In this file, you will need to add the following parameters:
    • milter_default_action – This is the default action to be taken when a message is received.
    • milter_protocol – This is the protocol to be used when communicating with OpenDKIM.
    • smtpd_milters – This is the list of milters that Postfix will use.
    sudo nano /etc/postfix/main.cf 
    

    Add the following lines at the end of this file, so Postfix will be able to call OpenDKIM via the milter protocol.

    # Milter configuration
    milter_default_action = accept
    milter_protocol = 6
    smtpd_milters = local:opendkim/opendkim.sock
    non_smtpd_milters = $smtpd_milters
    
  5. Once you have added the parameters, you will need to restart the OpenDKIm and Postfix services. To do this, you will need to run the following command:
    sudo systemctl restart opendkim 
    sudo systemctl restart postfix 
    

    This command will restart the both service, and you will be ready to send emails using OpenDKIM.

Step 6: Test DKIM

Send an email from system terminal as below:

mail -s "Welcome home" your_email@example.com 
cc:
Your email content goes here

Press CTRL+D to sent the email and get the terminal back. Watch the log files, On successful setup, you will see an log entry

Configure OpenDKIM with Postfix on Ubuntu

Check the email source. I have used my personal Gmail account to test this setup. I have received emails with the following header.

Configure OpenDKIM with Postfix on Ubuntu

You can follow our next article, to create a DMARC record for your domain.

Conclusion

In this step-by-step guide, I have shown you how to install and configure OpenDKIM with Postfix on Ubuntu. I have also shown you how to generate the necessary public and private DKIM keys, and add them to your DNS record. Finally, I have shown you how to configure Postfix to use OpenDKIM. So, if you are looking to secure and protect your email traffic, DKIM is a great tool to use. Give it a try, and unleash the power of DKIM!

If this article helped you out and you want to know more about OpenDKIM, you should check out our other articles on the topic. We have detailed guides on how to install and configure OpenDKIM on various platforms, as well as troubleshooting tips and best practices. So, make sure to check them out!

The post A Step-by-Step Guide to Installing OpenDKIM with Postfix on Ubuntu – Unleash the Power of DKIM! appeared first on TecAdmin.

]]>
https://tecadmin.net/setup-dkim-with-postfix-on-ubuntu-debian/feed/ 11
How to Create a Sudo User in Debian https://tecadmin.net/create-sudo-user-on-debian/ https://tecadmin.net/create-sudo-user-on-debian/#comments Sat, 19 Jun 2021 07:46:08 +0000 https://tecadmin.net/?p=25824 Sudo provides special privileges to users to run commands as another user. It can use used to allow superuser privileges to a normal user with restrictions. One can configure the sudo to give root privileges to the specific commands only. This tutorial helped you to create a new user with Sudo privileges, add an existing [...]

The post How to Create a Sudo User in Debian appeared first on TecAdmin.

]]>
Sudo provides special privileges to users to run commands as another user. It can use used to allow superuser privileges to a normal user with restrictions. One can configure the sudo to give root privileges to the specific commands only.

This tutorial helped you to create a new user with Sudo privileges, add an existing user to sudo privileges or remove sudo privileges from any account.

Create User with Sudo Access

Use the system’s default “adduser” command to create a new account. As per current requirements the command syntax will be like:

sudo adduser [USER_NAME} [GROUP_NAME] 

Here:

  • USER_NAME is the name of the new user account.
  • GROUP_NAME Define a group name here to automatically add user to this group during creation.

Let’s try with a real example. The following command will create a new user tecadmin and add it to sudo group.

sudo adduser tecadmin sudo 

In case of user already exist, it will simply add the user to the sudo group.

Add Existing User to Sudo

You can also use the following command to add existing users to group sudo, where it will get full sudo privileges.

sudo usermod -aG sudo tecadmin 

This will just add tecadmin user to the sudo group. One can verify the same in the /etc/group file.

Remove Sudo Privileges from User

The following command will remove a user from the sudo group. This will just remove the tecadmin user from the sudo group. It will not remove the user from the system.

sudo gpasswd -d tecadmin sudo 

We also recommend viewing the /etc/sources file and remove any user-specific entry.

Conclusion

This tutorial helped you to provide special permission to users using Sudo on a Debian system. Additionally, this tutorial provides you with permission to allow sudo access to the existing accounts. Also, remove Sudo privileges from the user.

The post How to Create a Sudo User in Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/create-sudo-user-on-debian/feed/ 1
How To Install XRDP (Remote Desktop) on Debian 10 https://tecadmin.net/how-to-install-xrdp-on-debian-10/ https://tecadmin.net/how-to-install-xrdp-on-debian-10/#comments Fri, 18 Jun 2021 07:06:35 +0000 https://tecadmin.net/?p=25761 XRDP is an open-source implementation of the Microsoft RDP (Remote Desktop Protocol) server. It provides bridging between the RDP client and the X windows system. The XRDP server allows remote users to graphical login to the remote machines using the Microsoft RDP client. The XRDP allows two-way clipboard transfer, audio and microphone voice redirection and [...]

The post How To Install XRDP (Remote Desktop) on Debian 10 appeared first on TecAdmin.

]]>
XRDP is an open-source implementation of the Microsoft RDP (Remote Desktop Protocol) server. It provides bridging between the RDP client and the X windows system. The XRDP server allows remote users to graphical login to the remote machines using the Microsoft RDP client.

The XRDP allows two-way clipboard transfer, audio and microphone voice redirection and allows us to mount local drives on the remote machines.

This tutorial helps you to Install XRDP Server (Remote Desktop) on the Debian 10 Linux system.

Prerequisities

You must have shell access with a sudo privilege user to the Debian 10 system

Step 1 – Installing Desktop Environment

By default, Debian Servers doesn’t have an installed Desktop Environment. XRDP server is designed to controls only desktop systems. So you will need to add a desktop environment to your system.

Open a terminal and upgrade all installed packages with the following command:

sudo apt update && apt install tasksel -y 

After installing Tasksel, launch the Tasksel utility with the following command:

sudo tasksel 

You should see the following interface:

Installing Desktop on Debian 10 with Tasksel

Use the arrow key to scroll down the list and find Debian Desktop Environment. Next, press the Space key to select it, also choose the Dekstop type, then press the Tab key to select OK then hit Enter to install the desktop environment.

Once all the packages are installed, you will need to set your system boots into the graphical target. You can set it with the following command:

sudo systemctl set-default graphical.target 

Next, restart your system to apply the changes.

Step 2 – Installing XRDP on Debian 10

The Xrdp Debian packages are available under the default system repositories. You can install a remote desktop on your Debian system by executing the following command.

sudo apt install xrdp -y 

Once the xrdp installation finished successfully, its service will be started automatically. To verify the service status run the command:

sudo systemctl status xrdp 

Running XRDP Server on Debian 10

The above output shows the Xrdp service is up and listening on port 3389.

Step 3 – Configuring Xrdp Service

The installation process creates a user named xrdp in your system. The XRDP sessions uses a certificate key file “/etc/ssl/private/ssl-cert-snakeoil.key”, which plays an important role with remote desktop. This key file is owned by root and the group owner is “ssl-cert”

So we need to allow xrdp user to access this key file. To do this, add the xrdp user to the “ssl-cert” group with the following command.

sudo usermod -a -G ssl-cert xrdp 

Sometimes user faces issue with black screen appears in background. So, that I ahave included steps to resolve black screen issue in background. Edit the xrdp file /etc/xrdp/startwm.sh in a text editor:

sudo nano /etc/xrdp/startwm.sh 

Add these commands before the commands that test & execute Xsession as shown below:

Unset DBUS_SESSION_ADDRESS
Unset XDG_RUNTIME_DIR

XRDP Fix Black Screen Issue

Press CTRL+O to write out and then CTRL+X to exit from the editor.

Restart the Xrdp service by running the command given below:

sudo systemctl restart xrdp 

Step 4 – Adjust Firewall

The Xrdp listens on port 3389, which is the default port for the RDP protocol. You need to adjust the firewall to allow access to port 3389 for remote systems.

Systems running with UFW firewall, use the following command to open port 3389 for the LAN network.

sudo ufw allow from 192.168.1.0/24 to any port 3389 

You can change 192.168.1.0/24 with 0.0.0.0/0 to open for all.

Reload the UFW to apply the new rules.

sudo ufw reload 

All right, Your system is ready to access over RDP protocol.

Step 5 – Connect to Remote Desktop

The Xrdp service is successfully installed and ready to connect. On your Windows client, open the RDP client and enter the IP address of the Debian system.

You can launch the RDP client by typing "mstsc" in the run window or command line.

Connect to Remote Desktop (RDP)

The first time, it will prompt a warning message due to the remote system is unknown for your system. Check the box in front of “Don’t ask me again for connection to this computer” and click Yes to continue.

Once connected successfully, the remote system prompt for authentication. Enter the login credentials of the remote Debian system to get remote desktop access.

On successful authentication, you’ll get remote desktop access.

Connected XRDP Session on Debian 10

That’s it. Now, you can manage your remote Debian system with a graphical interface.

Conclusion

This tutorial helped you to set up XRDP Server (Remote Desktop) service on Debian 10 Linux system. Additionally provides you the steps to install Desktop Environment on a Debian Linux system.

The post How To Install XRDP (Remote Desktop) on Debian 10 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-xrdp-on-debian-10/feed/ 1
Initial Server Setup with Debian 10/9/8 https://tecadmin.net/initial-server-setup-with-debian/ https://tecadmin.net/initial-server-setup-with-debian/#comments Sat, 05 Jun 2021 09:08:54 +0000 https://tecadmin.net/?p=25614 We have launched a new Debian Linux instance to run it as a production server for our new applications. This is a good practice to perform an initial server setup with the Debian Linux system. Which will enhance the primary server security and usability for your new server. This guide includes the following steps: Update [...]

The post Initial Server Setup with Debian 10/9/8 appeared first on TecAdmin.

]]>
We have launched a new Debian Linux instance to run it as a production server for our new applications. This is a good practice to perform an initial server setup with the Debian Linux system. Which will enhance the primary server security and usability for your new server.

This guide includes the following steps:

  1. Update and Upgrade a Debian System
  2. Create A Sudo User in Debian
  3. Setup Hostname in a Debian System
  4. Secure SSH Server
  5. Configuring FirewallD

Let’s begin with the initial server setup on the Debian Linux system.

1. Upgrade Debian

After login into the Debian server, the first task is to upgrade the current packages of the Debian system. Because It may be the server is built with the old image file. The Debian team keeps working to enhance server security and provide updated packages regularly.

First, update the Apt cache on your system.

sudo apt update 

Then, run the upgrade command to actually upgrade packages.

sudo apt upgrade 

It’s also a good choice to run the dist-upgrade for a newly installed system.

sudo apt dist-upgrade 

Press ‘Y’ for any confirmation prompted to complete the packages installation.

Initial server setup Debian - Upgrade Packages

Also, execute the following command to remove packages no longer required. This is also helpful to remove files of the old kernel versions.

sudo apt autoremove 

2. Create A Sudo User

Some of the hosting providers like DigitalOcean launches instances with root account only. This is not a good practice to keep using a production instance using the superuser account. We strongly recommend creating a new user with Sudo privileges and use that to accessing your Debian instance.

Assuming you are already logged in a root account. Run the following command to create a new User on Debian:

sudo adduser tecadmin 

Initial serer setup debian - create sudo user

The newly created account is a regular user. You will require the administrative privileges to perform multiple tasks. Grant the administrative privileges to this user by adding them in sudo group. To add user to sudo group, type:

sudo usermod -a -G sudo tecadmin 

Now, you can switch to a newly created account for further instructions.

sudo su - tecadmin 

3. Configure System’s Hostname

A hostname of a system is the name of the instance used as an identity for computer networks. It helps users and network machine to easily recognize a machine within a network in a human-readable format.

Its an good practice to set a proper hostname for your instance. In the system terminal type hostnamectl and hit enter:

hostnamectl 

This will give you details about system details including hostname. Even you can type hostname command to view systems hostname.

Next, change the system hostname to

sudo hostnamectl set-hostname debian10 

Once you updated the Systems’ hostname, you need to change to a new shell to activate in the current session. After changing the current shell, the shell prompt will be changed to a new hostname.

hostname 

Initial Server Setup Debian - Change Hostname

4. Securing SSH

SSH (Secure Shell) is the protocol used to connect remote servers. We recommended configuring the OpenSSH server to listen on a non-standard port. Which provides you another layer of security from hackers.

To change the default port and disable root login, edit OpenSSH configuration file /etc/ssh/sshd_config and do the following changes.

  • Change Default Port – It will be good to change default ssh port as default ports are always on attackers.
     Port 2232
    
  • Disable Root SSH Login – Also you would like to disable root login via ssh.
     PermitRootLogin no
    

Save the configuration file and restart the OpenSSH service to apply changes.

sudo systemctl restart ssh 

5. Configuring Firewall (FirewallD)

The Default Debian server edition does not have a firewall installed on it. You can simply run the following command to install required packages from default repositories.

sudo apt install firewalld -y 

On successful installation, firewall service will to auto started and enabled on your system.

The default firewall allows SSH to the remote users. But if the SSH port is changed, you can add a rule to allow SSH access on another port.

sudo firewall-cmd --permanent --add-port=2232/tcp 

You can directly provide a service name like “http” or “https” to allow. The firewalld reads /etc/services file to determine the corresponding port of the service.

sudo firewall-cmd --permanent --add-service=http 
sudo firewall-cmd --permanent --add-service=https 

After making any changes to your firewall, make sure to reload changes using the following command.

sudo firewall-cmd --reload 

To view, all the allowed ports and services use the following command.

sudo firewall-cmd --permanent --list-all 

Output:

public
  target: default
  icmp-block-inversion: no
  interfaces:
  sources:
  services: cockpit dhcpv6-client http https ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

Conclusion

In this guide, we have gone through the initial server setup of a Debian Linux system. Once you successfully finished all the initial server setup configurations, your system is ready to use.

The post Initial Server Setup with Debian 10/9/8 appeared first on TecAdmin.

]]>
https://tecadmin.net/initial-server-setup-with-debian/feed/ 3
How To Install and Configure VNC Server on Debian 10 https://tecadmin.net/how-to-install-vnc-server-on-debian-10/ https://tecadmin.net/how-to-install-vnc-server-on-debian-10/#comments Thu, 04 Mar 2021 16:53:58 +0000 https://tecadmin.net/?p=24864 VNC (Virtual Network Computing) allowed to remotely control desktop systems. We can say VNC is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol (RFB). There are multiple software services provides VNC service to access Linux based desktop remotely including, TigerVNC, TightVNC, Vino, vnc4server and more. The TigerVNC is a free, open-source and [...]

The post How To Install and Configure VNC Server on Debian 10 appeared first on TecAdmin.

]]>
VNC (Virtual Network Computing) allowed to remotely control desktop systems. We can say VNC is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol (RFB). There are multiple software services provides VNC service to access Linux based desktop remotely including, TigerVNC, TightVNC, Vino, vnc4server and more.

The TigerVNC is a free, open-source and high-performance VNC server used to control or access Linux based desktop remotely. It is a client/server application that allows you to interact with graphical applications on remote machines.

This tutorial help you to how to install and configure VNC server on Debian 10 Buster Linux system using the TigerVNC server.

Prerequisites

First, update and upgrade all installed packages on your system with the following command:

sudo apt update 
sudo apt upgrade

Once your system is updated, follow the next instructions.

Step 1 – Install Desktop Environment

The default, Debian servers does have a Desktop Environment. TigerVNC server is designed to controls only desktop systems. So you will need to add a desktop environment in your server.

First, install the Tasksel utility to install a desktop environment:

sudo apt install tasksel -y 

After installing Tasksel, launch the Tasksel utility with the following command:

sudo tasksel 

You should see the following interface:

Installing Desktop on Debian 10

  1. Move cursor to Debian Desktop Environment in the list.
  2. Press the Space key to select item.
  3. Press Tab key to move cursor to Ok button.
  4. Again hit Enter to start installation.

During installation it may prompt to choose Keyboard type and continue to install. Once all the packages are installed, you will need to set your system boots into the graphical target. You can set it with the following command:

sudo systemctl set-default graphical.target 

Next, restart your system to apply the changes.

Step 2 – Installing VNC Server on Debian

The TigerVNC package are available under default package repositories under Debian 10 system. You can install it by running the following command:

sudo apt install tigervnc-standalone-server -y 

After installing TigerVNC, create a new user and set a VNC password for that user.

First, create a new user named “rahul” (or choose other name of your choice) with the following command:

sudo adduser rahul

Next, switch the user to newly created account and set a VNC password with the following command:

su - rahul
vncpasswd 

Provide your desired password as shown below:

Password:
Verify:
Would you like to enter a view-only password (y/n)? n

Next, start the VNC server using the following command:

vncserver -localhost no 

Once the VNC server is started, you should get the following output:

/usr/bin/xauth:  file /home/rahul/.Xauthority does not exist

New 'tecadmin:1 (rahul)' desktop at :1 on machine tecadmin

Starting applications specified in /etc/X11/Xvnc-session
Log file is /home/rahul/.vnc/tecadmin:1.log

Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /home/rahul/.vnc/passwd tecadmin:1 to connect to the VNC server.

You can verify your running VNC server using the following command:

vncserver -list 

You should get the following output:

TigerVNC server sessions:

X DISPLAY #	RFB PORT #	PROCESS ID
:1		5901		1204

Step 3 – Installing VNC Client

In this section, we will install the RealVNC VNC client on the remote machine and connect to the VNC server.

You can download the RealVNC client from the RealVNC download page.

Once the download is completed, install the downloaded package with the following command:

dpkg -i /home/vyom/Downloads/VNC-Viewer-6.20.529-Linux-x64.deb  

Next, launch the VNC client from the Gnome application menu. Then, Click on the File menu => New connection to create a new connection. You should see the following screen:

Add server to vnc viewer

Provide the Name and IP address along with VNC session ID :1 of your VNC server and click on the OK to save the connection. You should see your saved connection in the following screen:

List of VNC servers

Now, double click on your newly created connection. You will be asked to provide your VNC password as shown below:

Connect to Vnc Server

Provide your VNC password and click on the OK. Once connected, you should see your Debian desktop screen:

Installing Vnc server on Debian 10

Step 4 – Configure VNC to Work with Your Desktop Environment

Before starting, stop the VNC instance using the vncserver command with a -kill option and the server session ID as an argument.

vncserver -kill :1 

You should get the following output:

Killing Xtigervnc process ID 1719… success!

Next, you will need to configure TigerVNC to work with Gnome. You can do it by creating new file xstartup inside .vnc directory:

su - rahul 
nano ~/.vnc/xstartup 

Add the following lines:

#!/bin/sh
exec /etc/vnc/xstartup
xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &

Save and close the file when you are finished. The above script will be executed automatically whenever you start or restart the TigerVNC server.

Next, give execute permissions to the ~/.vnc/xstartup file:

chmod u+x  ~/.vnc/xstartup 

Step 5 – Creating SystemD Unit File

Next, you will need to create a systemd file for TigerVNC to manage the VNC service. You can create it with the following command:

sudo nano /etc/systemd/system/vncserver@.service 

Add the following lines:

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
User=rahul
PAMName=login
PIDFile=/home/%u/.vnc/%H%i.pid
ExecStartPre=/usr/bin/vncserver -kill :%i > /dev/null 2>&1 || :
ExecStart=/usr/bin/vncserver :%i -localhost no -geometry 1024x768
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

Save and close the file then reload the systemd daemon with the following command:

sudo systemctl daemon-reload 

Next, enable the VNC service to start at system reboot with the following command:

sudo systemctl enable vncserver@1.service 

Next, start the VNC service with the following command:

sudo systemctl start vncserver@1.service 

Conclusion

Congratulations! you have successfully installed VNC server on a Debian 10 Linux Buster system. You can now connect your Debian desktop from any remote desktop systems using VNC Viewer.

The post How To Install and Configure VNC Server on Debian 10 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-vnc-server-on-debian-10/feed/ 2
How to Install TeamViewer on Debian 10 https://tecadmin.net/how-to-install-teamviewer-on-debian-10/ https://tecadmin.net/how-to-install-teamviewer-on-debian-10/#comments Tue, 15 Dec 2020 02:07:08 +0000 https://tecadmin.net/?p=23912 TeamViewer is a powerful remote desktop and file sharing application works with most of the operating systems and mobile devices. In order to commercial use of TeamViewer, you have to purchase license. You can use it free for personal use only. A Debian package is build by the team viewer team and available for the [...]

The post How to Install TeamViewer on Debian 10 appeared first on TecAdmin.

]]>
TeamViewer is a powerful remote desktop and file sharing application works with most of the operating systems and mobile devices. In order to commercial use of TeamViewer, you have to purchase license. You can use it free for personal use only.

A Debian package is build by the team viewer team and available for the installation on Ubuntu and Debian systems. You can download it from TeamViewer website with no charge.

This tutorial help you to how to install TeamViewer on Debian 10 (Buster) Linux system.

Prerequisites

  • A running Debian 10 system with desktop access.
  • Sudo privileged account access.

Installing TeamViewer on Debian 10

First of all, download the latest aavailable version of TeamViewer Deabian packages from its official download page. At the writing time of this tutorial, TeamViwer 15 is the latest available version to download and install on Ubuntu systems.

  1. Download TeamViewer – Download the latest verson of TeamViewer Debian package. It is available at TeamViewer for Linux download page. You can also download it via the Linux command line.
    wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb 
    
  2. Install TeamViewer – Install the downloaded TeamViewer debian package using the installer (dpkg) utility. If in case dpkg failed due to dependencies errors, use apt package manager to complete TeamViewer installation on Ubuntu system including all the required dependencies.
    sudo dpkg -i teamviewer_amd64.deb 
    sudo apt -f install 
    

That’s it. You have successfully installed TeamViewer on Debain 10 system.

Start TeamViewer Application

TeamViewer application have been successfully installed on your Ubuntu system. Next search “TeamViewer” under the utilities application search. You will see the TeamViewer application launcher as shown below:

launch teamviewer on Debian 10

Click the TeamViewer launcher icon to start application. With the first time startup, click “Accept License Agreement” button to start application.

install teamviewer on Debian 10

Info:
If you see any error related to Wayland support in GDM. You need to disable this feature. In Debian 10 and newer, GDM will use Wayland by default on supported hardware. Edit /etc/gdm3/daemon.conf file by uncommenting the WaylandEnable=false line.

/etc/gdm3/daemon.conf:

WaylandEnable=false 

Save file and restart your system.

Using TeamViewer

Once the application started, You will see the TeamViewer id assigned to your system with a random password. You can can change this password any time with auto generated password or define a custom password.

Use this teamviewer ID to connect this system from remote systems running with the same version of Teamviewer application. You can also use this teamviewer application to connect other teamviewer running on remote systems. You just need the teamviewer ID and password of the remote system.

Conclusion

This tutorial described you to how to install TeamViewer on Debian 10 systems.

The post How to Install TeamViewer on Debian 10 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-teamviewer-on-debian-10/feed/ 1
How to Install .NET Core on Debian 10 https://tecadmin.net/how-to-install-dotnet-core-on-debian-10/ https://tecadmin.net/how-to-install-dotnet-core-on-debian-10/#comments Sun, 08 Nov 2020 03:05:18 +0000 https://tecadmin.net/?p=22479 The .NET Core is a free and open-source software framework designed with keeping Linux and macOS in mind. It is a cross-platform successor to .NET Framework available for Linux, macOS and Windows systems. .NET Core framework already provides scaffolding tools for bootstrapping projects. This tutorial explained how to install .net core on Debian 10 Linux [...]

The post How to Install .NET Core on Debian 10 appeared first on TecAdmin.

]]>
The .NET Core is a free and open-source software framework designed with keeping Linux and macOS in mind. It is a cross-platform successor to .NET Framework available for Linux, macOS and Windows systems. .NET Core framework already provides scaffolding tools for bootstrapping projects.

This tutorial explained how to install .net core on Debian 10 Linux system.

Prerequsities

Login to your debain system with sudo privileged account.

Open a terminal, update the apt cache and install below required packages

sudo apt update 
sudo apt install apt-transport-https 

Step 1 – Enable Microsoft PPA

First of all, you need to enable Microsoft packages repository on your Debian system. The Microsoft official team provides a Debian packages to create PPA file on your system.

Open a terminal on your Debian system and configure Microsoft PPA by run the following commands:

wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb 
sudo dpkg -i packages-microsoft-prod.deb 

Step 2 – Installing .NET core on Debian

The .NET Core SDK is the Software development kit used for developing applications. The .net runtime used for running application build on .net core.

Open a terminal and execute below commands to install .NET Core SDK:

sudo apt update 
sudo apt install dotnet-sdk-3.1 

To install the previous version of .Net Core SDK 2.1, type:

sudo apt install dotnet-sdk-2.1

Step 3 – Installing .NET core Runtime Only

.NET Core Runtime is required for the system, where you only need to run application. For example, production or stating environments are required to run applications only.

Execute following commands to install .NET Core runtime only:

sudo apt update 
sudo apt install dotnet-runtime-3.1 

To install the previous version of .Net core runtime 2.1, type:

sudo apt install dotnet-runtime-2.1

Conclusion

This tutorial helped you to install .NET Core on a Debian 10 Buster Linux system.

The post How to Install .NET Core on Debian 10 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-dotnet-core-on-debian-10/feed/ 2
How to Install and Use FFmpeg on Debian 10 https://tecadmin.net/install-ffmpeg-on-debian-10/ https://tecadmin.net/install-ffmpeg-on-debian-10/#respond Mon, 12 Oct 2020 14:33:23 +0000 https://tecadmin.net/?p=23231 FFmpeg is an open-source application used to work with audio, video, video streams and other multimedia files. You can use ffmpeg to convert video files, extract audio, reducing file size, convert file types. Using ffmpeg, we can also create a video stream from a video file publish over rtmp protocol. This tutorial will help you [...]

The post How to Install and Use FFmpeg on Debian 10 appeared first on TecAdmin.

]]>
FFmpeg is an open-source application used to work with audio, video, video streams and other multimedia files. You can use ffmpeg to convert video files, extract audio, reducing file size, convert file types. Using ffmpeg, we can also create a video stream from a video file publish over rtmp protocol.

This tutorial will help you to install ffmpeg on Debian 10 Linux system.

Install FFmpeg on Debian 10

At the day of writing this article, the FFmpeg 4.1.6 is available under the default apt repositories. You can use the apt command line utility to install ffmpeg on your Debian 10 Linux system.

sudo apt update 
sudo apt install ffmpeg 

Next check the installed version of ffmpeg on your Debian system.

ffmpeg -version 

Output:

ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)

Working with FFmpeg

The ffmpeg command line interface provides a large number of options to work with it. Below is the list of basic command line options used with ffmpeg.

FFmpeg command examples
    ffmpeg -version: show version ffmpeg -formats: show available formats ffmpeg -codecs: show available codecs ffmpeg -decoders: show available decoders ffmpeg -encoders: show available encoders ffmpeg -bsfs: show available bit stream filters ffmpeg -protocols: show available protocols ffmpeg -filters: show available filters ffmpeg -pix_fmts: show available pixel formats ffmpeg -layouts: show standard channel layouts ffmpeg -sample_fmts: show available audio sample formats

As as basic command line example, below command will reduce the size of a .mov file.

Reduce .mov File Size:

ffmpeg -i input.mov -c:v libx264 -c:a copy -crf 20 output.mov 

You can also convert a file format using ffmpeg command line. Below example command will change .mov file to .mp4 video format.

Convert .mov To .mp4

ffmpeg -i input.mov -vcodec copy -acodec aac -strict experimental -ab 128k output.mp4 

Conclusion

This tutorial provides you instruction’s to how to install ffmpeg on debian 10 Linux system. You can also visit the official documentation page to learn more about ffmpeg uses on Linux system.

The post How to Install and Use FFmpeg on Debian 10 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-ffmpeg-on-debian-10/feed/ 0
How to List Installed Repositories In Ubuntu & Debian https://tecadmin.net/view-installed-repositories-in-ubuntu/ https://tecadmin.net/view-installed-repositories-in-ubuntu/#respond Mon, 05 Oct 2020 15:28:12 +0000 https://tecadmin.net/?p=23056 A repository is the collection of packages for a Linux operating system. You can create a central repository containing the actual packages. Then configure your other systems to connect with the main repository. From where, you can install, update packages. The Ubuntu and other Debian based systems uses APT (Advanced Packages Tool) as package manager. [...]

The post How to List Installed Repositories In Ubuntu & Debian appeared first on TecAdmin.

]]>
A repository is the collection of packages for a Linux operating system. You can create a central repository containing the actual packages. Then configure your other systems to connect with the main repository. From where, you can install, update packages.

The Ubuntu and other Debian based systems uses APT (Advanced Packages Tool) as package manager. Apt keeps all the configuration files under /etc/apt directory.

This tutorial will help you to list all installed repositories under a Ubuntu or Debian based system via command line.

List Installed Repositories In Ubuntu

The remote repository references are configured in /etc/apt/sources.list file and all files under /etc/apt/sources.list.d/ directory.

Use the following command to list all the configured repositories on apt based system:

sudo grep -rhE ^deb /etc/apt/sources.list* 

You will see the output like below:

deb http://mirrors.digitalocean.com/ubuntu/ xenial main restricted
deb-src http://mirrors.digitalocean.com/ubuntu/ xenial main restricted
deb http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted
deb http://mirrors.digitalocean.com/ubuntu/ xenial universe
deb-src http://mirrors.digitalocean.com/ubuntu/ xenial universe
.
.
.
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

Alternatively, you can use apt-cache command to list all repositories. This command will provide also provide more details about the repository.

Let’s try below command:

sudo apt-cache policy 

Output:

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages
     release v=16.04,o=LP-PPA-ondrej-php,a=xenial,n=xenial,l=***** The main PPA for supported PHP versions with many PECL extensions *****,c=main,b=amd64
     origin ppa.launchpad.net
 500 https://deb.nodesource.com/node_13.x xenial/main amd64 Packages
     release o=Node Source,n=xenial,l=Node Source,c=main,b=amd64
     origin deb.nodesource.com
.
.
.
 500 http://mirrors.digitalocean.com/ubuntu xenial/main amd64 Packages
     release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=main,b=amd64
     origin mirrors.digitalocean.com
Pinned packages:

Conclusion

In this tutorial, you have learned to find all the repositories configured on Ubuntu or Debian based system.

The post How to List Installed Repositories In Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/view-installed-repositories-in-ubuntu/feed/ 0
How To Install Apache mod_cloudflare on Debian https://tecadmin.net/install-apache-mod-cloudflare-on-debian/ https://tecadmin.net/install-apache-mod-cloudflare-on-debian/#comments Sun, 04 Oct 2020 04:46:32 +0000 https://tecadmin.net/?p=23045 Cloudflare is the most popular content delivery network service provider. Which also incudes DNS, DDoS protection and security for the websites. In action cloudflare act as reverse proxy server. Once the website traffic is routed with cloudflare network, the backend server don’t know the actual visitor ip. In result, you will see the cloudflare IP [...]

The post How To Install Apache mod_cloudflare on Debian appeared first on TecAdmin.

]]>
Cloudflare is the most popular content delivery network service provider. Which also incudes DNS, DDoS protection and security for the websites. In action cloudflare act as reverse proxy server. Once the website traffic is routed with cloudflare network, the backend server don’t know the actual visitor ip. In result, you will see the cloudflare IP address in Apache logs.

Now the question is how to get the real visitor IP in logs, instead of cloudflare IP. To resolve this, cloudflare provides an Apache module to get real visitor ip and log them.

This tutorial will help you to enable Apache mod_cloudflare module on Debian system. Which will log real visitor IP address to Apache access logs.

Install Apache mod_cloudflare on Debian

The cloudflare provides an official module for the Apache server to capture real ip address. You need to enable the PPA of cloudflare module to your Ubuntu system.

Add GPG – Open a terminal and execute below commands to enable add gpg key to your system.

sudo apt install curl 
curl -C - https://pkg.cloudflare.com/pubkey.gpg | sudo apt-key add - 

Add PPA – Then add the cloudflare repository to your debian system

echo "deb http://pkg.cloudflare.com/ `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/cloudflare.list 

Install Package – Next, update Apt cache and install libapache2-mod-cloudflare package on your Ubuntu system.

sudo apt update 
sudo apt install libapache2-mod-cloudflare 

Press ‘Y’ for any confirmation asked during the installation.

Restart Apache

Once the installation completed, restart Apache2 service and check the active modules using the following commands.

sudo systemctl restart apache2 

That’s it. The Apache server will log real IP address of the visitor to the logs.

sudo apache2ctl -M 

Conclusion

In this tutorial, you have learned to install Apache cloudflare module on Debian Linux system.

The post How To Install Apache mod_cloudflare on Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/install-apache-mod-cloudflare-on-debian/feed/ 1