The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘*nix’ Category

How to Setup Chroot SFTP in Linux (Allow Only SFTP, not SSH)

Posted by jpluimers on 2018/12/24

If you want to setup an account on your system that will be used only to transfer files (and not to ssh to the system), you should setup SFTP Chroot Jail.

This explains how: [WayBack] How to Setup Chroot SFTP in Linux (Allow Only SFTP, not SSH)

Posted in *nix, *nix-tools, Communications Development, Development, Internet protocol suite, Power User, SFTP, SSH, TCP | Leave a Comment »

Dieses sudo-Gehampel unter Debian/Ubuntu nervt. Aber es gibt Abhilfe: alias…

Posted by jpluimers on 2018/12/24

[WayBack] Dieses sudo-Gehampel unter Debian/Ubuntu nervt. Aber es gibt Abhilfe: alias iddqd=’sudo su -‘ – Kristian Köhntopp – Google+

Or maybe this:

iddqd='sudo -i'

–jeroen

PS: “sudo su -” vs “sudo -i”

 

Posted in *nix, Linux, Power User | Leave a Comment »

Reptyr – Forgot to “screen” your ssh session first, and now that long running…

Posted by jpluimers on 2018/12/24

From a while back, but still so cool! It allows you to “recover” the terminal (stdin/stdout/stderr) of a process that was attached to a terminal or ssh session.

Reptyr – Forgot to “screen” your ssh session first, and now that long running thing is stuck?

»reptyr PID will grab the process with id PID and attach it to your current terminal.«

server:~ # zypper install reptyr
...
Retrieving: reptyr-0.3dev_git20120325-7.1.2.x86_64.rpm ...................[done]
(1/1) Installing: reptyr-0.3dev_git20120325-7.1.2 ........................[done]
server:~ # rpm -qi reptyr
...
Summary     : A tool for "re-ptying" programs
Description :
reptyr is a utility for taking an existing running program and
attaching it to a new terminal. Started a long-running process over
ssh, but have to leave and don't want to interrupt it? Just start a
screen, use reptyr to grab it, and then kill the ssh session and head
on home.
Distribution: openSUSE 13.1

Source: [WayBack] Reptyr – Forgot to “screen” your ssh session first, and now that long running thing is stuck?… – Kristian Köhntopp – Google+

It works with tmux too and is supported on many Linux distributions, see for instance [WayBackReptyr – Move A Running Process From One Terminal To Another Without Closing It – OSTechNix.

You can even redirect a pty for gdb usage: [WayBackreptyr(1): new terminal – Linux man page

StackExchange thread: [WayBack] How to recover a shell after a disconnection with these entries:

Originally from 2011 [WayBackreptyr: Attach a running process to a new terminal – Made of Bugs it is still maintained:

GitHub repository [WayBacknelhage/reptyr: Reparent a running program to a new terminal

–jeroen

Posted in *nix, *nix-tools, Linux, openSuSE, Power User, screen, SuSE Linux, tmux | Leave a Comment »

linux – Keeping the fancy sudo warning forever – Super User

Posted by jpluimers on 2018/12/21

Be careful what you do: blindly following Super User can make sudo unavailable: [WayBacklinux – Keeping the fancy sudo warning forever – Super User.

Following the answer archived in the WayBack machine gets you into this situation:

sudo -i
>>> /etc/sudoers.d/privacy: syntax error near line 1 <<<
sudo: parse error in /etc/sudoers.d/privacy near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

The cause:

I forgot to put a line terminator at the end of the line in the privacy file.

If you do that, then it works fine: add this line INCLUDING A LINE TERMINATOR to /etc/sudoers.d/privacy (any file in that directory will do):

Default lecture=always

Related

–jeroen

Posted in *nix, *nix-tools, Power User | Leave a Comment »

linux – Is there a way to remove “Last message repeated x times” from logs? – Server Fault

Posted by jpluimers on 2018/12/17

One day I will need to enable repeating those messages: [WayBack] linux – Is there a way to remove “Last message repeated x times” from logs? – Server Fault

–jeroen

Posted in *nix, *nix-tools, Linux, Power User | Leave a Comment »

OpenSuSE Tumbleweed E20 on Raspberry Pi 3: accessing the enlightenment desktop over VNC after automatic logon

Posted by jpluimers on 2018/12/14

For a keyboard-less Raspberry Pi machine that functions as a read-only screen, I needed:

  • automatic logon
  • remote VNC accessibility
  • no screen blanking

I already had the E20 ([WayBackEnlightenment) X11 server running as that’s the first image on [WayBackHCL:Raspberry Pi3 – openSUSE that as a graphical UI that works.

Read the rest of this entry »

Posted in *nix, *nix-tools, Power User, Screen sharing, VNC/Virtual_Network_Computing, X11, X11vnc | Leave a Comment »

Links for Nagios openSuSE Tumbleweed monitoring (including Android devices)

Posted by jpluimers on 2018/12/13

For my link archive:

Non-stable repos:

–jeroen

Posted in *nix, Linux, Monitoring, Nagios, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »

on my research list: autossh

Posted by jpluimers on 2018/12/12

Having mainly used ssh as a means to connect to a shell on remote machines and occasionally a manual port forward.

I never noticed autossh where you can automate the ssh logon process to keep permanent port forwards up and running. Cool!

It’s on my research list now, as this will be useful probably sooner than later:

My initial impression is that autossh is a wrapper around the regular ssh client that allows reconnection upon communication failures.

–jeroen

Posted in *nix, *nix-tools, Communications Development, Development, Internet protocol suite, Power User, SSH, TCP | Leave a Comment »

Adding Windows machines to Samba domains and security

Posted by jpluimers on 2018/12/07

If adding a Windows machine to a Samba domain fails and the below “solves” your issue, then you need to tighten the security on the Samba side:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]
; Enable NT-Domain compatibility mode
; Default:
; [value not present]
; "DomainCompatibilityMode"=-
"DomainCompatibilityMode"=dword:00000001

; Disable required DNS name resolution
; Default:
; [value not present]
; "DNSNameResolutionRequired"=-
"DNSNameResolutionRequired"=dword:00000000


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon\Parameters]
; Disable requirement of signed communication
; My Samba (3.0.33) works with signed communication enabled, so no need to disable it.
; Default:
; "RequireSignOrSeal"=dword:00000001
; Disable the usage of strong keys
; Default:
; "RequireStrongKey"=dword:00000001
"RequireStrongKey"=dword:00000000

–jeroen

Posted in *nix, *nix-tools, Power User, samba SMB/CIFS/NMB, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows 9 | Leave a Comment »

Backing up ZFS snapshots

Posted by jpluimers on 2018/12/06

An interesting idea at [WayBack] I was getting concerned about a backup, which had exceeded 1GB, when the data was only about 400MB. Once the job finished, I realized: Ahh, ZFS compres… – Dan Langille – Google+:

Here’s that script I use for creating/destroy the snaphots for a particular long dataset name. Then I backup from /mnt

[WayBackgist.github.com/dlangille/480dbca509562eb03e76c2e1b576c6d2 is in sh, not even bash.

–jeroen

Read the rest of this entry »

Posted in Development, Power User, Scripting, sh, ZFS | Leave a Comment »