0

I have a weird problem when I want to change settings in NoMachine.

I get the error: Authentication failed, please try again.

https://share.cleanshot.com/C4lnTBKn

My password is working in the terminal, etc. On the second machine, I have the same configuration and don't have this error. I have researched the forum and the internet, trying different approaches like:

But I still get the same error. I have tried rebooting, restarting, and reinstalling NoMachine. Additionally, I noticed that I must log out with my Ubuntu by VNC when I connect with NoMachine, or else I get an extended desktop. Below is a step-by-step guide for how I installed NoMachine on my Ubuntu:

  • I installed Ubuntu Server minimal, and then:

# 1. Update your package lists

sudo apt update

2. Install LXQt

sudo apt install lxqt

3. Install Xorg (if not installed)

sudo apt install xorg

4. Download NoMachine package

wget https://download.nomachine.com/download/8.5/Linux/nomachine_8.5.3_1_amd64.deb

5. Install NoMachine package

sudo dpkg -i nomachine_8.5.3_1_amd64.deb

6. Fix missing dependencies

sudo apt -f install

lindaz
  • 11

1 Answers1

0
#!/bin/bash

# Update package lists
sudo apt update

# Ensure LXQt and Xorg are installed
sudo apt install -y lxqt xorg

# Download NoMachine package (version as of your example)
wget -q https://download.nomachine.com/download/8.5/Linux/nomachine_8.5.3_1_amd64.deb

# Install NoMachine
sudo dpkg -i nomachine_8.5.3_1_amd64.deb
sudo apt -f install -y

# Check and configure PAM for NoMachine
if [ ! -f /etc/pam.d/nx ]; then
    echo "Copying PAM configuration from sshd to nx"
    sudo cp /etc/pam.d/sshd /etc/pam.d/nx
else
    echo "Updating PAM configuration for nx"
    echo -e "auth    include     system-auth\naccount include     system-auth\npassword include   system-auth\nsession include    system-auth" | sudo tee /etc/pam.d/nx > /dev/null
fi

# Check user permissions (assuming the user is the one running this script)
echo "Current user info:"
whoami
getent passwd $(whoami)
getent shadow $(whoami)

# Log inspection
echo "Checking NoMachine logs for errors:"
sudo cat /var/log/nxserver.log | tail -n 20
sudo cat /var/log/nxerror.log | tail -n 20

# SELinux and AppArmor checks
if command -v getenforce &> /dev/null; then
    echo "SELinux status:"
    sudo getenforce
    if [ "$(sudo getenforce)" = "Enforcing" ]; then
        echo "Setting SELinux to Permissive mode for troubleshooting"
        sudo setenforce 0
    fi
else
    echo "SELinux not installed."
fi

if command -v aa-status &> /dev/null; then
    echo "AppArmor status:"
    sudo aa-status
fi

# Reset NoMachine configuration
echo "Resetting NoMachine configuration:"
sudo rm -rf ~/.nx /usr/NX/etc/*
sudo dpkg -i nomachine_8.5.3_1_amd64.deb

# Ensure case sensitivity of username is correct
echo "Your username case:"
whoami

# Reinstall NoMachine to ensure all dependencies are correctly installed
echo "Reinstalling NoMachine:"
sudo apt-get remove --purge -y nomachine
sudo apt-get autoremove -y
sudo apt-get clean
sudo apt-get update
sudo apt-get install -f -y
wget -q https://download.nomachine.com/download/8.5/Linux/nomachine_8.5.3_1_amd64.deb
sudo dpkg -i nomachine_8.5.3_1_amd