1
34
submitted 2 years ago* (last edited 1 year ago) by [email protected] to c/[email protected]

When you delete your posts on this sub, you are deleting a solution to a potential problem that someone may be having. It is inconsiderate and can result in a ban.

2
5
Yazi on antix. (lemmy.zip)
submitted 10 hours ago by [email protected] to c/[email protected]

Been using yazi for a while, started using antix linux & I can't get. ANY previews working. No images, no pdf or text files. Almost everything else works but no previews. I also can't get it to use micro as the text editor. (I just found a plug-in for that so I'll see what I can do) Any help with previews would be amazing 🫶

3
15
submitted 1 day ago* (last edited 1 day ago) by [email protected] to c/[email protected]

Hello everyone!

As the title says, I am trying to set up email alerts on my server whenever there is a successful ssh connection (will also setup the same for failed connections with fail2ban later). I already have the email script created and it works (I use it to monitor the directories containing all of these security scripts for changes so that I also get notified if anything critical is modified or deleted in those directories).

I also created a very basic user called test for - you guessed it - testing purposes. This user doesn't have a home directory or anything like that.

Here are the relevant scripts:

$ cat /usr/local/bin/login-alert.sh
#!/bin/bash

# Sends alerts only for real terminals not cron jobs
if [[ -n "$SSH_CONNECTION" ]]; then
	USERNAME=$(whoami)
	IP=$(echo $SSH_CONNECTION | awk '{print $1}')
	HOST=$(hostname)
	DATETIME=$(date)
	/usr/local/bin/semail \
		-s "[CRITICAL] SSH Login to $HOST" \
	 	-b "Login detected:\n\nUser: $USERNAME\nIP: $IP\nTime: $DATETIME\nTTY: $SSH_TTY"
fi

$ cat /usr/local/bin/semail
#!/bin/bash

# Default values
TO="[email protected]"
FROM="notifications@my_server.com"
SUBJECT=""
BODY=""
BODY_FILE=""


# Help function
show_help() {
cat <<EOF
Usage: $0 [OPTIONS]

Send a test email using Postfix.

Options:
  -t, --to EMAIL            Recipient email address (default: $TO)
  -s, --subject TEXT        Subject of the email (required)
  -b, --body TEXT           Body text of the email
  -f, --body-file FILE      File to read body text from (overrides --body)
  -h, --help                Show this help message

If no body or body-file is provided, you will be prompted to enter the body interactively.

Examples:
  $0 -s "Test subject" -b "Hello\nThis is a test"
  $0 --subject "Test" --body-file message.txt
EOF
}

# Parse arguments
while [[ "$#" -gt 0 ]]; do
	case "$1" in
		-t|--to)
			TO="$2"
			shift 2
			;;
		-s|--subject)
			SUBJECT="$2"
			shift 2
			;;
		-b|--body)
			BODY="$2"
			shift 2
			;;
		-f|--body-file)
			BODY_FILE="$2"
			shift 2
			;;
		-h|--help)
			show_help
			exit 0
			;;
		*)
			echo "Unknown option: $1"
			show_help
			exit 1
			;;
	esac
done

# Validate required parameters
if [[ -z "$SUBJECT" ]]; then
	echo "Error: --subject is required."
	show_help
	exit 1
fi

# Handle body input
if [[ -n "$BODY_FILE" ]]; then
	if [[ ! -f "$BODY_FILE" ]]; then
		echo "Error: Body file '$BODY_FILE' does not exist."
		exit 1
	fi
	BODY=$(<"$BODY_FILE")
elif [[ -z "$BODY" ]]; then
	echo "Enter the body of the email (end with Ctrl-D):"
	BODY=$(</dev/stdin)
fi

# Send email
{
	echo "From: $FROM"
	echo "To: $TO"
	echo "Subject: $SUBJECT"
	echo "Content-Type: text/plain; charset=UTF-8"
	echo
	printf "%b\n" "$BODY"
} | /usr/sbin/sendmail -t -f "$FROM"

# /usr/sbin/sendmail -f "$FROM" "$TO" <<EOF
# From: $FROM
# To: $TO
# Subject: $SUBJECT

# $BODY
# EOF

echo "Email sent to $TO"

And here is the output I see when I login as the test user:

ssh test@my_server.com
test@my_server.com's password:
dir=/ failed: exit code 2
dir=/ failed: exit code 2
Linux my_server 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Aug 15 07:08:24 2025 from my_ip_address
Could not chdir to home directory /home/test: No such file or directory

I don't get email alerts for any user, neither the test user nor my regular admin user.

Here is my /etc/pam.d/sshd relevant lines:

# Standard Un*x session setup and teardown.
account optional pam_exec.so seteuid dir=/ /usr/local/bin/login_notify.sh
@include common-session

I also tried with session instead of account and without the dir=/ part.

Can anyone help me troubleshoot this please?

Thanks in advance. Of course if you need any more info I'll do my best to provide it :)

4
15
submitted 4 days ago by [email protected] to c/[email protected]

Does anyone know what could be causing this and maybe a potential fix?

I'm using Manjaro Linux with KDE.

5
4
submitted 3 days ago* (last edited 2 days ago) by [email protected] to c/[email protected]

Recently started using Antix Linux & it's great so far. What I need to know is if there is a power menu I can use in place of the power off command that runs when I press my power button. It is placed inconveniently above the backspace key & I shut down my computer on accident all the time. (I have a terrible condition called "Ham Hands") I know I can write in # Normal handling. /usr/sbin/pm-suspend At the end of the code at /etc/acpi/powerbtn-acpi-support.sh but I don't want to suspend the computer either. Just a pop up menu.

if [ -x /etc/acpi/powerbtn.sh ] ; then # Compatibility with old config script from acpid package /etc/acpi/powerbtn.sh elif [ -x /etc/acpi/powerbtn.sh.dpkg-bak ] ; then # Compatibility with old config script from acpid package # which is still around because it was changed by the admin /etc/acpi/powerbtn.sh.dpkg-bak else # Normal handling. /sbin/shutdown -h -P now "Power button pressed" fi

6
19
submitted 1 week ago by [email protected] to c/[email protected]

I am running Fedora KDE. I generally use 150% scaling. When I am using game streaming like Boosteroid or GeForce Now, I want to set that to 100%.

Is there an easy way to configure a "toggle" for this? Is there a shell command for example that I could turn into a script?

7
12
submitted 1 week ago by [email protected] to c/[email protected]

So, I've had this idea for awhile. I want to host a mobile os (maybe nix or something touch compatible) on my server and remote into it from various phones. The smoothest experience I've used was the Microsoft remote desktop where you can set a shortcut on your home screen, get in there real fast, and touch controls work great. But windows is spyware, so I'm passed all that. Played around with kasm and other things. Just curious to see if anyone has tried to "live" on a remote desktop before and has suggestions or a guide. Thanks!

8
7
submitted 1 week ago by [email protected] to c/[email protected]

I'm trying to get a certain program to require sudo to use it. Is this possible?

9
3
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/[email protected]

slstatus, dwlb, dwl

I've been trying to do this for the last few hours to no avail.

I can't start dwlb via dwl's autostart patch, as it doesn't work properly that way for some reason (current workspace isn't highlighted, window title doesn't appear etc.), so I have to do dwl -s 'dwlb' to start it.

I edited this script for it to use slstatus instead of someblocks, but it doesn't work either as in dwlb doesn't even start (I tried using both the autostart patch and the -s flag):

#!/bin/sh

dwlb &
sleep 0.1
slstatus -s | dwlb -status-stdin all

Directly using the command dwl -s 'dwlb && slstatus -s | dwlb -status-stdin all' did actually work once, but stopped working for some reason after that (I didn't recompile anything, I just rebooted and it stopped working. dwlb does start but the status bar doesn't work.).

Any help is greatly appreciated.

10
6
Make waybar stable and reliable (lemmy.frozeninferno.xyz)
submitted 3 weeks ago by [email protected] to c/[email protected]

So, i'm on hyprland and right now i've setup

exec-once = zsh -c 'sleep 1' && ps aux | rg ' [w]aybar' || while pgrep -f Hyprland > /dev/null ; do (waybar); done

what i need is to add a clause that terminates the "while true; do (waybar); done" that way when the compositor is restarted it kills the previous instance of while true do waybar

Just to break down the reasoning for my current command,

sleep 1 is to prevent certain stupid bugs from occurring that might be fixed now but weren't in the early days

ps aux part is to make sure waybar isn't already running

while pgrep -f Hyprland is SUPPOSED to end the loop when Hyprland ends, but it does not. I don't know why.

The reason for the while loop is to restart waybar if it crashes, but right now, when i restart hyprland (I use wl-restart) the previous while loop doesn't actually close, and waybar binds to the previous hyprlands IPC and I end up with no workspace icons or window names. Any ideas for making this work?

11
10
submitted 3 weeks ago* (last edited 2 weeks ago) by [email protected] to c/[email protected]

Ok, first off KDE Connect is a killer app. It's so slick and convenient. Love it.

My desktop is running Fedora 42 Workstation with Gnome. Since I've got GNOME instead of KDE, I'm using an extension called GSConnect to communicate with KDE connect on my phone. It's working perfectly.

I've also got this extension called "Display Configuration Switcher" that lets me use a keyboard shortcut ( ctrl + ; ) to switch between two display configs:

  1. Standard desktop layout
  2. TV only.

(Fedora 42 is using Wayland, when I was on X11 I could use ARandR to create custom commands but Wayland is... more complicated.)

I want to add a command to KDE Connect/GSConnect to switch my display configuration from "desktop" output to "TV" output. The problem is I don't know what command to invoke to trigger "Display Configuration Switcher" to swap configurations.

There are multiple ways to approach this. The best solution is just to figure out what command is invoked when I press the keyboard shortcut "ctrl + ;", which is the shortcut to switch display configs. I'm not sure how to see what command is run when I press a button or shortcut.

Alternatively, I could find a way to send the ctrl + ; shortcut from the KDE connect app. Sending keyboard shortcuts would be handy regardless, but this is a workaround.

Any help would be appreciated. Thank you in advance!

EDIT: Ok, a lot of options below worked!

  • wtype and ydotool can be used to send keystrokes via commands. While wtype didn't work for me, ydotool did! It requires setting up a daemon to run in the background on system boot.

  • Simply installing a keyboard on android that supports modifier keys (specifically the ctrl key) works too. I used Unexpected Keyboard. Once installed and enabled you can go into KDE Connect > remote input > keyboard and hit the language icon/globe thing and your keyboard swaps between the preferred keyboard and Unexpected keyboard. On UK press Ctrl and swipe down&right on the “n” key to access semicolon and my display config switches.

  • My preferred solution, however, is using gdctl and pactl to manually set the dispay and audio output. Once I figured out the commands I put them in a bash script and point GSConnect to that. My displayConfig_tv.sh script looks like this:

#!/bin/bash
gdctl set --logical-monitor \
--primary \
--monitor HDMI-2 \
--mode [email protected]
pactl set-default-sink alsa_output.pci-0000_2f_00.1.hdmi-stereo-extra3

My TV by default wanted to be 4K at 60Hz, which makes everything too small and at 60Hz everything was stuttery. I had to add the "--mode [email protected]" to force it to 1080p at 120Hz.

(Also of note is that I was having an issue with one of my desktop monitors having a weird refresh rate. I kept trying to set the monitor to "--mode 2560x1440@144" but got an error that no such mode existed. I ended up setting the refresh rate through GNOME settings and running "gdctl show" to see what the current profile was, which was 2560x1440@144.006. Including the ".006" fixed my issue.)

The final issue I'm having is the pactl command fails because the TV audio-out doesn't exist until the display is enabled. My fix is just to press the command a second time once the TV is active. I may see if adding a "time sleep" or something to the bash script fixes this issue.

Thank you to everyone who helped!

12
22
submitted 4 weeks ago* (last edited 4 weeks ago) by [email protected] to c/[email protected]

Every now and then my Samba share stops working.

$ smbclient -U sambauser '\\192.168.12.11\Apartment'
do_connect: Connection to 192.168.12.11 failed (Error NT_STATUS_CONNECTION_REFUSED)

This is incredibly annoying, since it happens somewhat frequently too. I restart the container, with no fix. It might be client-side, but I'm boggled by how that could even occur. There are no logs in systemd for smbd. The firewall is disabled.

/etc/samba/smb.conf: https://pastebin.com/HNgw8YcV

13
1
Issues with remote viewer (lemmy.dbzer0.com)
submitted 1 month ago by [email protected] to c/[email protected]

When I try opening remote viewer on a computer with display scaling it scales the opposite way to what it's supposed to, making the image smaller rather than larger.

.vv files will also try to open with kate from Firefox, even though the system default application is set correctly as it works fine from a file manager.

This is on CachyOS with KDE.

14
10
submitted 1 month ago by [email protected] to c/[email protected]

I got a legion 5 gaming laptop back in like 2020 and while the laptop itself works fine, about a year or two in the screen brightness just... stopped funtioning. I was still on windows at the time, but the issue is still here now and I'd really like to be able to use Plasma's new hdr-without-hdr thing. As far as I can tell, there is nothing wrong with the hardware in my computer.

that being said, I've run windows (which it came with), ubuntu, tuxedo os, and fedora (current) on this laptop and aside from the brightness sometimes briefly coming back after a restart until I restart again (I think it happens after updates when it happens but it's so rare I can't tell), it won't come back. I'm using lvfs for firmware stuff and do get stuff from it sometimes, and I keep my system up to date. I haven't been able to find any solutions online so I figured my best bet would be to ask here. anyone know how to fix or at least diagnose it?

15
10
submitted 1 month ago by [email protected] to c/[email protected]

I have a bit of an odd issue with my Surface Pro 3, which is running Debian 12.

Occasionally (perhaps 1 in 15 to 20 boots) it fails to detect the keyboard properly (this is a genuine Microsoft keyboard cover that connects via the pins on the edge of the Surface, not one of the generic bluetooth ones you can get now). When that happens, the onscreen keyboard logo appears in the top right corner whilst the grub boot menu is displayed.

When it then tries to boot Debian, it throws some kind of Secure Boot error and displays this error message:

SbatLevel variable initialization failed
Something has gone seriously wrong: SbatLevel UEFI variable setting failed: Invalid Parameter

I then have to force it to power off and then try booting again. Usually it works the next time around.

This one's got me stuck, as I don't know much about the Secure Boot process and I've struggled to find any other references to this error online apart from this question on Reddit (which unfortunately didn't resolve it).

I find it particularly odd that this error only seems to occur when there's an issue with the physical keyboard, despite me being able to use the onscreen keyboard in grub. I can replicate this behaviour by detaching the keyboard and it consistently produces this error.

Apart from trying to address the intermittent keyboard issues, which I am looking into (I may need to buy a new one), I have no idea where to start with the Secure Boot issue. Any suggestions would be much appreciated. Thanks.

Update:

Whilst I don't fully understand why this error was occuring, I did manage to resolve it.

My Debian installation was using the default kernel (6.1.0-35-amd64 and 6.1.0.37-amd64 were installed) and selecting this would consistently cause the SbatLevel error with the keyboard removed.

Installing the Linux Surface project kernel (currently 6.15.1-surface-2) per the instructions allows me to consistently boot without the error with the keyboard detached.

16
8
submitted 1 month ago by [email protected] to c/[email protected]

Is there any easy to use Distro that specializes in a Thin-Client area?

thinstation is not building on my PC as it justs supports Fedora (i use arch, btw ;-))

I Need a VM to Connect to a corporate VPN and then to a Win11-Host over RDP.

The VPN is with MFA, that is already annoying, as the GUI clients i know cannot store the password when using MFA and my password is extremely long.

RDP to a win11 host is not working atm as freeRDP is always telling that the KDC is not reachable.

atm i use a tiny10-VM with the windows OpenVPN client for this (working fine) but i want to switch to linux for that, as win10 is ending, and win11 will not run in a vm (CPU not supported)

17
10
submitted 2 months ago by [email protected] to c/[email protected]

(this is just as a matter of curiosity)

we now have a couple distros using musl instead of (or along side of) glibc, so I got to wondering (got sidetracked by) if anyone had done a similar project with tcc replacing gcc?

18
10
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]

Hello, I recently bought an old Lenovo Thinkpad X130e (ca. 2012) and tried installing Linux Mint ver. 22.1 Xfce edition into the laptop's HDD and received a "Linux Mint unable to install GRUB in dev/sda" error that only let me boot into a GRUB terminal after rebooting. Is there an easily available installation guide/manual for this laptop I could take a look at? I've tried adjusting the BIOS' UEFI/boot settings but haven't had any luck. I figure there's a way to manually configure the HDD to have a bootable partition during installation but I'm not sure what I'm doing exactly.

UPDATE: Finally fixed the issue. I rebooted on the USB stick iso after the latest GRUB install error and ran the Boot Repair utility from the start menu. It automatically fixed the issue and was able to successfully boot without the USB. Hopefully this helps someone if they run into a similar issue later.

19
15
submitted 2 months ago by [email protected] to c/[email protected]

So I'm on ZorinOS, and I go to

Zorin Appearance > Interface >

And in that Menu is the option ""Left Super Key".

I've been led to believe that's where I assign the action of the windows key. Except it's greyed out.

I'd like it to do exactly what it does on WindowsXP and Windows 7, where a start menu pops up.

At one time it did that. Then now it's a totally different action that I can't quite explain. It's like it shows every single open app in a zoomed out view, and you can click one to zoom in on that window. I know, my description sucks.

But I can't select Left Super Key, and I don't know linux well enough to know why.

20
12
submitted 2 months ago by [email protected] to c/[email protected]

I plug in an external 1TB Crucial X8 portable SSD via USB but the OS can't detect it. I used to use the SSD as external storage for a PS4. I can plug it into my phone and a Chromebook and both detect the drive automatically. I've tried reformatting the drive via my phone and the Chromebook, I have connected it via 3 different USB ports, and tried another USB cable, all with no success.

What else can I try?

21
7
submitted 2 months ago by [email protected] to c/[email protected]

So I am ricing my first linux desktop, I want to blur the background of alacritty when I am using it Ive managed to make it transparent

22
9
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]

Recently, my NixOS system has started taking around 2 minutes to boot. The delay happens when stopping system-udevd and multiple USB errors are thrown during it. I've tried booting with zero usb devices connected, but the issue still occurs. I have also tried updating my mobo, disabling XHCI handoff, legacy USB support, and the builtin wireless chipset. I haven't even been able to identify what USB port could be causing the issue. Motherboard is an MSI X670E TOMAHAWK WIFI.

Hastebin dump with the journalctl, lsusb -t, lsusb, lspci, and usb-devices output

Full dmesg dump

I would really appreciate any help, I've been losing my mind trying to fix this.

Edit: I looked at some dumps on linux-hardware.org, it seems likely that its the bluetooth chipset causing the issue. I'd already disabled this in the motherboard settings, but that apparently isn't enough.

If anybody knows how to make systemd-udevd ignore this device, I would really appreciate it.

Edit 2: Stumbled onto this post from someone with a Gigabyte X670 which seems to use the same BT chipset, which led to this post which recommend unplugging the computer for a bit.

I left it unplugged overnight and lo and behold the next morning the issue is gone. What a bizarre problem.

23
10
submitted 2 months ago by [email protected] to c/[email protected]

Reposting my question here to cast a wider net

24
11
submitted 2 months ago by [email protected] to c/[email protected]

I'm using Ubuntu on my Dell XPS 17, connected to a Dell Dock via USB-C, that has 2 monitors connected with Displayport. Sometimes on signal acquisition, screens remain black, and I have to lock the session (Win + L), wait a few seconds, then wake up the laptop, so signal may or may not be correctly acquired (otherwise I'd do it again until it works)

On Windows, there's this shortcut, Win + Ctrl + Shift + B, that acts as if the screen were disconnected/reconnected. It may help with my signal acquisition problem. Is there an equivalent on Ubuntu/Linux, please ?

25
13
submitted 3 months ago by [email protected] to c/[email protected]

cross-posted from: https://sh.itjust.works/post/37507334

I'm trying to generate AppArmor policies to secure my "major/internet-facing" programs.
Most of those programs are Flatpaks.
Flatpaks already have their own sandboxing mechanism, which uses bwrap and XDG portals.
Does AppArmor have any weird interactions with Flatpak, e. g. blocking too much, or blocking too little, or being unable to block anything without rendering the whole program unusable?

view more: next ›

Linux Questions

2432 readers
8 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 2 years ago
MODERATORS