Thursday, May 27, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Gnome Applications menu doesn't reveal locations of apps

Posted: 27 May 2021 10:55 AM PDT

I've tried to use the following command, but it is missing the available applications listed in the Applications menu of the Gnome GUI/Desktop environment. I am not sure how to access the information for how these apps are being launched. In KDE or RHEL 6 Gnome (Gnome 2.x), it was easy to just right click on the application launcher and see the command it was using to launch the application. However with Gnome 3 on RHEL 8 I have had no such luck.

rpm -qa  

systemd: Timeout for ExecStartPre

Posted: 27 May 2021 10:32 AM PDT

I am working with a systemd service file with a long-running ExecStartPre. (If you must know, it is an aws route53 wait resource-record-sets-changed that runs for a while) and the timeout seems to be 90 seconds. Setting TimeoutSec does not seem to change this.

How do I change the timeout?

# systemctl --version  systemd 245 (245.4-4ubuntu3.6)  +PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid  

Install GuixSD using and existing Linux system

Posted: 27 May 2021 10:27 AM PDT

I want to install Guix System Distribution (or GuixSD, or just Guix) alongside some other distros. The problem is, Guix doesn't recognise Realtek drivers, which are nonfree, so I can't use WiFi. I can install Guix with Ethernet, but it is very unstable, so I want to install it with my existing Debian (buster) installation so I can then add the Nonguix channel and install the drivers. Problem is, I don't really know how.

I'm pretty sure it includes installing Guix onto Debian, installing some packages, and strapping GuixSD onto the root (atleast, that's how NixOS does it, which Guix is inspired by) or it includes chrooting into the ISO.

I would appreciate any help possible.

System Info

# neofetch # some info was filtered    root@deblugo   ---------------   OS: Debian GNU/Linux 10 (buster) x86_64   Host: HP Notebook   Kernel: 4.19.0-16-amd64   Packages: 1624 (dpkg)   Shell: bash 5.0.3    CPU: Intel Celeron N3060 (2) @ 2.480GHz   GPU: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx   Memory: 1931MiB / 3803MiB     # lsb_release -a  No LSB modules are available.  Distributor ID: Debian  Description:    Debian GNU/Linux 10 (buster)  Release:    10  Codename:   buster    # uname -a  Linux deblugo 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux    # cat /etc/os-release  PRETTY_NAME="Debian GNU/Linux 10 (buster)"  NAME="Debian GNU/Linux"  VERSION_ID="10"  VERSION="10 (buster)"  VERSION_CODENAME=buster  ID=debian  HOME_URL="https://www.debian.org/"  SUPPORT_URL="https://www.debian.org/support"  BUG_REPORT_URL="https://bugs.debian.org/"  

Dual booting leads to grub menu

Posted: 27 May 2021 10:21 AM PDT

I have a PC with two hard drives. When I bought it, there was Windows 10 on one hard drive and Ubuntu on the other. I replaced Ubuntu with Manjaro, and this was totally fine. When I booted I got a boot menu where I could select either Manjaro or Windows.

Today I decided to replace Windows with Artix. I created a bootable USB with the Artix base openrc. I booted from this drive and followed the instructions found at https://wiki.artixlinux.org/Main/Installation. I didn't get any errors, and everything was successful. However, when I rebooted my computer it boots into a GNU Grub command line like interface. After some searching I found this menu comes up when grub is damaged/can't find operating systems. From this menu I can boot into Manjaro but not Artix - in fact, I still haven't been able to get into Artix except from the bootable USB.

Curiously enough when I go to my PC's BIOS and select the boot drive, there are two options - Manjaro and Grub. Grub takes me to the seemingly useless grub command line or Manjaro. If I select Manjaro my PC boots as it did before and the option in the Manjaro boot menu to boot into Windows is still there (it doesn't work obviously anymore).

How can I fix this so I get a choice between Artix and Manjaro when I boot? I've gone through every single forum regarding grub I can find and probably typed hundreds of commands at this point - nothing seems to actually do anything. Also, is there any comprehensive guide out there for grub/dual booting? All the guides seem to be really poor (think, "just insert your bootable USB and it just works™").

Reading user Plist files from /var/db/dslocal/nodes/Default/users/

Posted: 27 May 2021 10:51 AM PDT

Identifying active as well as hidden users in macOS (Catalina) can be achieved using the following command

 dscl . -list /Users | grep -vE '_|root|nobody|daemon|Guest'  

Which gives me the following output:enter image description here

Referring to a post here ,it is inferred that the user specific plist files residing in var/db/dslocal/nodes/Default/userscan be read using defaults read or plutil -p command . I am interested in using a single line code using xargs and dscl . -list /Users | grep -vE '_|root|nobody|daemon|Guest' to read the plist files in /var/db/dslocal/nodes/Default/users. Suggestions are welcome as I tried this:

sudo  dscl . -list /Users | grep -vE '_|root|nobody|daemon|Guest'|xargs -0 -n 1 sh -c 'sudo plutil -p /var/db/dslocal/nodes/Default/users/"$1.plist"' _  

Ended in no luck !

How SSH authentication works?

Posted: 27 May 2021 09:13 AM PDT

My question is based on this scenario. Servera and serverb/user1 and user2. Both users present on both the servers.

user1 on servera has ssh key pairs generated and public key copied to authorized key on serverb.

user2 on servera has no ssh key pairs generated and also on serverb.

user1 logged into servera.. user 1 trying to ssh to serverb as user2(ssh user2@serverb) its works fine, no password asked.

My question is this. How does this work? user 2 has no pub keys on serverb. I always thought SSH authenticated the user trying to login. Does this mean SSH on serverb authenticates the currently logged in user1 on servera.

du command errors

Posted: 27 May 2021 09:35 AM PDT

Why does du /sys give an erroneous result? Using the file manager, properties shows it has a size of 619 MB, which is feasible. But du -hs /sys shows 0 MB? There are smaller-sized folders such as /etc, which the file manager shows a size of 8.4 MB, although du shows it as 15 MB. So there seems to be a lot of inconsistency.

Checking if a subdirectory exists using glob in script

Posted: 27 May 2021 10:06 AM PDT

I'm trying to check if a directory bin is inside a directory which can sometimes change. In this particular case, the version number of ruby can change (e.g. $HOME/.gem/ruby/2.6.0/bin). Here's what I did so far:

#!/usr/bin/env zsh  ruby_gem_home="$HOME/.gem/ruby/*/bin"  if [[ -d $ruby_gem_home ]]; then    echo "The ruby gems directory exists!"  else    echo "Ruby gems directory missing!"  fi  

I don't want to use find as this is part of a login process. What's the most elegant way, using built-in zsh/bash commands, to achieve this?

Thanks!

EDIT: Forgot to mention this is for a zsh script.

How "ip route add" if mask not CIDR

Posted: 27 May 2021 10:41 AM PDT

How add to route, for example IP Range 192.168.0.0 and mask 255.255.255.0

I know that: 255.255.255.0 = 24 (cidr), but i need make command in sh script, like:

route add -net 192.168.0.0 netmask 255.255.255.0 dev ppp0 but exactly with ip route ?

Repeat: , i get 255.255.255.0 as variable in script. , i know about ip route add 192.168.0.0/24 dev ppp0

Any variants?

iptables: forward packet to another network

Posted: 27 May 2021 08:12 AM PDT

I have two machines on 2 different networks which are interconnected.

First network:

  • 10.0.0.0/24

Second network:

  • 10.0.1.0/24

The first network is running an OpenVPN under 10.0.0.10 with ipv4_forwarding enabled.

The second network is running a bastion server under 10.0.1.20 with ipv4_forwarding enabled.

The second network has a routing rule to access some S2S with this range: 10.1.0.0/16


I'm trying to figure out how can I receive packets on the OpenVPN client that will be forwarded to the bastion server and from there to the S2S only when the packets are actually heading towards this specific range (10.1.0.0/16).

Do I need to alter the iptables on the bastion server or forwarding is sufficient?

Thank you very much :)

How to create ".img" from files

Posted: 27 May 2021 10:38 AM PDT

I'm trying to alter some files inside an ".img" file.

Example:

logo-x.squashfs.img  romfs-x.squashfs.img  safeEnv.img  sign.img  

For that, I extracted the ".img" using 7-Zip and made the changes needed. Archiving these altered files with 7-Zip is not possible though, so I searched a tool to do that but could not find one that is capable of creating the ".img" as it was originally.

I tried to use ImgBurn but it seems to create a different file from the original one. Also tried to use DD but could not make it work with files instead of volumes.

Please, how could I read the original ".img" file to learn its format and create a new one from the new files?

How to create repo for multiple Linux distros

Posted: 27 May 2021 07:26 AM PDT

How would I create a mirror for multiple different linux distros on a red hat system? I know you can use createrepo on red hat and apt-mirror on debian based distros, but the apt-mirror package is not available on Red Hat it seems.

I've seen repositories that are basically a "master" repo with packages for every major distribution, yet its running on the same web server. How is this possible?

Stuck sandisk x400 m.2

Posted: 27 May 2021 08:53 AM PDT

I'm very new here but I have a theory in which I would like to know whether it's possible or not.

I have a Sandisk x400 M.2 SSD which isn't readable and doesn't show up in BIOS or other places. There is no LBA access most likely due firmware which is stuck and victoria doesnt come up nothing also.

It's connected to a USB SATA device which is Jmicron. It's shown in device list but not the sandisk.

Can I write to USB -> Jmicron SATA port -> SSD and then test if I could read the send info to see if it is functioning? Or is it that SSD controller and firmware wont let me pass through the NAND chip and I cant do anything?

But my question then is: If pc-3000 can do it and read disk, why isn't it possible via this way?

Of course pc-3000 suite is engineering top tier and they have probably different way doing it, right?

Does anyone know how they do it? I have important data on disk, and I cant get it out.

Also people claiming the SSD is dead period. That's partly true, but it's fixable. I've read many articles that Chinese engineers have recovered data from SSD only with computer and suitable software. I can't find the firmware for this drive either. Anyone have clue?

Split CSV file with timestamp along breaks for defined period

Posted: 27 May 2021 08:05 AM PDT

I wonder if there's an easy way, maybe one liner, with unix cli tools to split a CSV file with ISO-8601 UTC timestamps in millisecond precision (+%FT%T.%3NZ, e. g. 2021-05-27T13:59:33.641Z) along a defined time offset / break / difference, like for example two hours.

As always there are certain different ways of having it and while for other users with similar questions, other options might also be relevant in a comprehensive answer, I ...

  • ... use/have git 2.31.1's GNU Bash 4.4.23, GNU sed 4.8, GNU Awk 5.0.0 (and all the other tools it bundles), xsv 0.13.0 and jq 1.6 on Windows 7
  • ... would rather use this in a script that in an interactive shell
  • ... use a semicolon (;) as delimiter, no comma
  • ... do not have my values quoted (e. g. in single (') or double quotes ("))
  • ... do not have a header
  • ... would already have the entire CSV in a variable and would also want to have the result in variables (an array?) in order to be able to further analyze them
  • My columns do not have a fixed lengths in reality and may contain spaces and hyphens besides alphanumerical characters
  • The timestamp is the fifth of eight columns in my real world data
  • The file can be assumed to be at most 250k lines and 20 MiB
  • While it would be preferable if the script/command took less than half a second on my i5-4300U, 5 to 10 seconds max would still not be a dealbreaker

Example

If I had 2 hours as offset to use for my split (and I did not mix anything up), this file:

abc;square;2021-05-27T14:15:39.315Z  def;circle;2021-05-27T14:17:03.416Z  ghi;triang;2021-05-27T14:45:13.520Z  abc;circle;2021-05-27T15:25:47.624Z  ghi;square;2021-05-27T17:59:33.641Z  def;triang;2021-05-27T18:15:33.315Z  abc;circle;2021-05-27T21:12:13.350Z  ghi;triang;2021-05-27T21:15:31.135Z  

would get split to the following three parts

abc;square;2021-05-27T14:15:39.315Z  def;circle;2021-05-27T14:17:03.416Z  ghi;triang;2021-05-27T14:45:13.520Z  abc;circle;2021-05-27T15:25:47.624Z  
ghi;square;2021-05-27T17:59:33.641Z  def;triang;2021-05-27T18:15:33.315Z  
abc;circle;2021-05-27T21:12:13.350Z  ghi;triang;2021-05-27T21:15:31.135Z  

disclaimer: I am no native speaker, so if rewording makes this question more comprehensible please go for it. The verbosity re. e.g. also specifying the options that do not apply to my use case (comma, quotes) or using both the word semicolon and the sign ; in this question's text is for SEO purposes

Insert text after first letter of pattern

Posted: 27 May 2021 10:06 AM PDT

How could I insert /foo/ after and only after opening brackets?

(bar)  

should become

(/foo/bar)  

while (/baz/bar) should not become (/baz/foo/bar)

Why is /bin in the path?

Posted: 27 May 2021 10:56 AM PDT

Now that almost all modern mainstream Linuxes and Unixes have /bin as a symbolic link to /usr/bin, why is it that by default the PATH contains /usr/bin followed by /bin? Will I break anything if I clean up my PATH by removing /bin? I assume it's there by default for compatibility reasons of some sort, but I can't think what.

Unsigned Debian Jessie Release error

Posted: 27 May 2021 08:00 AM PDT

I am trying to update my system using sudo apt update, but I am getting this output when trying to do so:

Hit:1 https://dl.winehq.org/wine-builds/ubuntu focal InRelease  Hit:2 https://deb.debian.org/debian buster InRelease                              Hit:3 https://deb.debian.org/debian-security buster/updates InRelease             Ign:4 http://ppa.launchpad.net/cybermax-dexter/sdl2-backport/ubuntu impish InRelease  Ign:6 https://storage.googleapis.com/cros-packages/91 buster InRelease            Hit:7 https://storage.googleapis.com/cros-packages/91 buster Release              Err:8 http://ppa.launchpad.net/cybermax-dexter/sdl2-backport/ubuntu impish Release    404  Not Found [IP: 91.189.95.85 80]  Ign:5 http://cdn-fastly.deb.debian.org/debian jessie InRelease                    Hit:10 http://deb.i2p2.no unstable InRelease                                      Get:9 http://cdn-fastly.deb.debian.org/debian jessie Release [77.3 kB]  Get:11 http://cdn-fastly.deb.debian.org/debian jessie Release.gpg [1,652 B]  Ign:11 http://cdn-fastly.deb.debian.org/debian jessie Release.gpg  Reading package lists... Done  E: The repository 'http://ppa.launchpad.net/cybermax-dexter/sdl2-backport/ubuntu impish Release' does not have a Release file.  N: Updating from such a repository can't be done securely, and is therefore disabled by default.  N: See apt-secure(8) manpage for repository creation and user configuration details.  W: GPG error: http://cdn-fastly.deb.debian.org/debian jessie Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010 NO_PUBKEY CBF8D6FD518E17E1  E: The repository 'http://http.debian.net/debian jessie Release' is not signed.  N: Updating from such a repository can't be done securely, and is therefore disabled by default.  N: See apt-secure(8) manpage for repository creation and user configuration details.  

I do not know how to fix this, so any help would be greatly appreciated.

In-built laptop camera and mic don't work, are universal drivers available?

Posted: 27 May 2021 09:03 AM PDT

I am using the Eve 5 2-in-1 laptop from a small enthusiasts manufacturer. The device came with windows installed and the in-built camera and microphone work with this OS. But more often I use the other partition on the device - Ubuntu 20.04.2. On it the in-built camera and mic don't work (but I can use external mics from headphones). From looking in the forums of the device I found that the device doesn't have drivers for the camera and mic for Linux. Here you can see the output of my lsusb and lsusb -v commands:

lsusb  Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  Bus 001 Device 004: ID 0603:00f1 Novatek Microelectronics Corp. Keyboard (Labtec Ultra Flat Keyboard)  Bus 001 Device 003: ID 8087:0a2b Intel Corp.   Bus 001 Device 006: ID 046d:c062 Logitech, Inc. M-UAS144 [LS1 Laser Mouse]  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  

Here you can read a little bit more what people in the support forum have discussed. Here is the output of sudo lshw -class multimedi:

sudo lshw -class multimedia  [sudo] password for nestor:     *-multimedia:0                     description: Multimedia controller         product: Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Imaging Unit         vendor: Intel Corporation         physical id: 5         bus info: pci@0000:00:05.0         version: 01         width: 64 bits         clock: 33MHz         capabilities: msi pm cap_list         configuration: driver=ipu3-imgu latency=0         resources: irq:140 memory:dc000000-dc3fffff    *-multimedia:1         description: Multimedia controller         product: Intel Corporation         vendor: Intel Corporation         physical id: 14.3         bus info: pci@0000:00:14.3         version: 01         width: 64 bits         clock: 33MHz         capabilities: msi pm bus_master cap_list         configuration: driver=ipu3-cio2 latency=32         resources: irq:142 memory:dd810000-dd81ffff    *-multimedia:2         description: Audio device         product: Sunrise Point-LP HD Audio         vendor: Intel Corporation         physical id: 1f.3         bus info: pci@0000:00:1f.3         version: 21         width: 64 bits         clock: 33MHz         capabilities: pm msi bus_master cap_list         configuration: driver=snd_hda_intel latency=32         resources: irq:126 memory:dd838000-dd83bfff memory:dd800000-dd80ffff  

Is there a way to make the in-built camera and mic work on Ubuntu? Are there some kind of universal drivers? Tnx

How to use openssl shake256 hash string into a specified length hash-string?

Posted: 27 May 2021 08:49 AM PDT

How to use openssl shake256 hash string to a specified length hash-string? I use the following command to generate a shake256 hash string with the default length in Linux:

echo -n 28713 | openssl shake256  

It works, but I want shorter return value.

In the paper: SHA-3 Wiki Shake256 can hash string with a specified length.

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available

Posted: 27 May 2021 09:51 AM PDT

I'm using Kali Linux 2020.1, I installed Python3.7, then after trying to install modules using pip3 command I keep getting this error message.

  WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.      ERROR: Could not find a version that satisfies the requirement flask (from versions: none)      ERROR: No matching distribution found for flask        Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping  

How to install wine32 in Debian 9?

Posted: 27 May 2021 10:12 AM PDT

I'm faced with the following problem when I attempt to install wine32 on Debian 9.9:

# apt-get install wine32  Reading package lists... Done  Building dependency tree         Reading state information... Done  Some packages could not be installed. This may mean that you have  requested an impossible situation or if you are using the unstable  distribution that some required packages have not yet been created  or been moved out of Incoming.  The following information may help to resolve the situation:    The following packages have unmet dependencies:   wine32:i386 : Depends: libwine:i386 (= 1.8.7-2) but it is not going to be installed  E: Unable to correct problems, you have held broken packages.  

Capture the output of a shell function without a subshell

Posted: 27 May 2021 08:39 AM PDT

I have rbenv (ruby version manager) installed on machine and it works like that:

$ rbenv local  2.3.1  

Writing to stdout the local version of my ruby. I want to rescue this version and declare it in a variable to reuse in another occasion.

$ declare -r RUBY_DEFINED_VERSION=$(rbenv local)  $ echo Using ruby version $RUBY_DEFINED_VERSION  Using ruby version 2.3.1  

It works!

But I don't want to use a subshell to do the work (using $() or ``). I want to use the same shell and I don't want to create a tmp file to do the work.

Is there a way to do this?

Note: declare -r is not mandatory, it can be a simple var=FOOBAR.

ssh_dispatch_run_fatal: message authentication code incorrect

Posted: 27 May 2021 09:47 AM PDT

Since a few days I'm facing an issue while being connected to my server in ssh, for proxy/tunel usage.

I - Setup

Client

Here is the machine :

iMac:~ Luca$ sw_vers

ProductName: Mac OS X

ProductVersion: 10.11.6

BuildVersion: 15G1108

iMac:~ Luca$ sudo sysctl net.inet.ip.forwarding

net.inet.ip.forwarding: 0

iMac:~ Luca$ sudo sysctl net.inet.ip.fw.enable

net.inet.ip.fw.enable: 1

Tried on three different network.

Browser

I'm using Firefox 50.0.1 to browse internet, with the FoxyProxy extension configured like so :

host address : 127.0.0.1

port : 9999

socks v5

SSH command

I'm using Terminal.app to connect in ssh to my server.

iMac:~ Luca$ ssh -p 53 -D 9999 luca@myIP

Server

luca@myServer:~$ ssh -V

OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016

luca@myServer:~$ cat /proc/sys/net/ipv4/ip_forward

1

II - Expected

Once the connection is open, I can browse any website without any issue (with my IP being my server one).

This was fine until a few days. This is still fine if I try :

  • same server (A), another computer (Y)
  • same computer (X), another server (B)

From what it looks like, it doesn't work with my computer (X) and my server (A).

III - What happens

luca@myServer:~$ ssh_dispatch_run_fatal: Connection to myIP: message authentication code incorrect

The connection is then closed.

This message appears at random time. But I can reproduce it easily with a big data load through the proxy : load multiple videos, download big files, etc...

IV - Another way, similar problem

If I connect to my server through sftp:// (with FileZilla) with the same login (luca) and same port (53). Then I try to download a file, every <30 seconds I get the following error :

Error : Incorrect MAC received on packet

Once again, this happen only with my computer (X) and my server (A). If I try another server (B) on the same computer (X) : no problem. If I try the same server (A) on another computer (Y) : no problem.

V - What I've tried (and didn't fix)

  1. Reboot the server and the computer
  2. Restart ssh/sshd on both the server and the computer
  3. Delete the knowns_hosts file on the computer
  4. Specify a -m and -c with the ssh command
  5. Specify a -o GSSAPIKeyExchange=no within the ssh command
  6. Uncomment the Ciphers and/or MACs lines within /etc/ssh/ssh_config on the server or/and the computer
  7. Tried to look at -vvvvv option with the ssh command and read logs on server/computer, nothing looked related.

Any help would be appreciated.

APPENDIX

Server ssh -Q mac

luca@myServer:~$ ssh -Q mac hmac-sha1 hmac-sha1-96 hmac-sha2-256 hmac-sha2-512 hmac-md5 hmac-md5-96 hmac-ripemd160 hmac-ripemd160@openssh.com umac-64@openssh.com umac-128@openssh.com hmac-sha1-etm@openssh.com hmac-sha1-96-etm@openssh.com hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com hmac-md5-etm@openssh.com hmac-md5-96-etm@openssh.com hmac-ripemd160-etm@openssh.com umac-64-etm@openssh.com umac-128-etm@openssh.com

Computer ssh -Q mac

iMac:~ Luca$ ssh -Q mac hmac-sha1 hmac-sha1-96 hmac-sha2-256 hmac-sha2-512 hmac-md5 hmac-md5-96 hmac-ripemd160 hmac-ripemd160@openssh.com umac-64@openssh.com umac-128@openssh.com hmac-sha1-etm@openssh.com hmac-sha1-96-etm@openssh.com hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com hmac-md5-etm@openssh.com hmac-md5-96-etm@openssh.com hmac-ripemd160-etm@openssh.com umac-64-etm@openssh.com umac-128-etm@openssh.com

Server ssh -v -p 53 -D 9999 luca@myIP

iMac:~ Luca$ ssh -v -p 53 -D 9999 luca@myIP    OpenSSH_6.9p1, LibreSSL 2.1.8  debug1: Reading configuration data /etc/ssh/ssh_config  debug1: /etc/ssh/ssh_config line 21: Applying options for *  debug1: Connecting to myIP [myIP] port 53.  debug1: Connection established.  debug1: key_load_public: No such file or directory  debug1: identity file /Users/Luca/.ssh/id_rsa type -1  debug1: key_load_public: No such file or directory  debug1: identity file /Users/Luca/.ssh/id_rsa-cert type -1  debug1: key_load_public: No such file or directory  debug1: identity file /Users/Luca/.ssh/id_dsa type -1  debug1: key_load_public: No such file or directory  debug1: identity file /Users/Luca/.ssh/id_dsa-cert type -1  debug1: key_load_public: No such file or directory  debug1: identity file /Users/Luca/.ssh/id_ecdsa type -1  debug1: key_load_public: No such file or directory  debug1: identity file /Users/Luca/.ssh/id_ecdsa-cert type -1  debug1: key_load_public: No such file or directory  debug1: identity file /Users/Luca/.ssh/id_ed25519 type -1  debug1: key_load_public: No such file or directory  debug1: identity file /Users/Luca/.ssh/id_ed25519-cert type -1  debug1: Enabling compatibility mode for protocol 2.0  debug1: Local version string SSH-2.0-OpenSSH_6.9  debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u3  debug1: match: OpenSSH_6.7p1 Debian-5+deb8u3 pat OpenSSH* compat 0x04000000  debug1: Authenticating to myIP:53 as 'luca'  debug1: SSH2_MSG_KEXINIT sent  debug1: SSH2_MSG_KEXINIT received  debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none  debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none  debug1: expecting SSH2_MSG_KEX_ECDH_REPLY  debug1: Server host key: ecdsa-sha2-nistp256 SHA256:DUAAYL1r0QUDtRI89JozTTz+bm5wcg4cOSaFaRdbr/Y  debug1: Host '[myIP]:53' is known and matches the ECDSA host key.  debug1: Found key in /Users/Luca/.ssh/known_hosts:1  debug1: SSH2_MSG_NEWKEYS sent  debug1: expecting SSH2_MSG_NEWKEYS  debug1: SSH2_MSG_NEWKEYS received  debug1: SSH2_MSG_SERVICE_REQUEST sent  debug1: SSH2_MSG_SERVICE_ACCEPT received  debug1: Authentications that can continue: publickey,password  debug1: Next authentication method: publickey  debug1: Trying private key: /Users/Luca/.ssh/id_rsa  debug1: Trying private key: /Users/Luca/.ssh/id_dsa  debug1: Trying private key: /Users/Luca/.ssh/id_ecdsa  debug1: Trying private key: /Users/Luca/.ssh/id_ed25519  debug1: Next authentication method: password    luca@myIP's password:    debug1: Authentication succeeded (password).  Authenticated to myIP ([myIP]:53).  debug1: Local connections to LOCALHOST:9999 forwarded to remote address socks:0  debug1: Local forwarding listening on ::1 port 9999.  debug1: channel 0: new [port listener]  debug1: Local forwarding listening on 127.0.0.1 port 9999.  debug1: channel 1: new [port listener]  debug1: channel 2: new [client-session]  debug1: Requesting no-more-sessions@openssh.com  debug1: Entering interactive session.  debug1: Sending environment.  debug1: Sending env LANG = fr_FR.UTF-8  Debian GNU/Linux 8.6    Linux <server> #1 SMP Tue Mar 18 14:48:24 CET 2014 x86_64 GNU/Linux    server    : 274305  hostname  : myServer  eth0 IPv4 : myIPv4  eth0 IPv6 : myIPv6  Last login: Thu Dec  8 15:36:09 2016 from XXX.XXX.XXX.XXX    luca@myServer:~$  

Error I see sometime

luca@myServer:~$ Bad packet length 3045540078.

padding error: need -1249427218 block 8 mod 6

ssh_dispatch_run_fatal: Connection to 5.39.88.21: message authentication code incorrect

Server ssh -o macs=hmac-sha1 -v -p 53 -D 9999 luca@myServer when crash happens

iMac:~ Luca$ ssh -o macs=hmac-sha1 -v -p 53 -D 9999 luca@myIP  // [...]  luca@myServer:~$ debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 3: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 4: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 5: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 6: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 7: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 8: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 9: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 10: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 11: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 12: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 13: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 14: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 15: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 16: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 17: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 18: new [dynamic-tcpip]  debug1: Connection to port 9999 forwarding to socks port 0 requested.  debug1: channel 19: new [dynamic-tcpip]  ssh_dispatch_run_fatal: Connection to myIP : message authentication code incorrect  iMac:~ Luca$  

After updating SSH on client-side

iMac:~ Luca$ ssh -V  OpenSSH_7.3p1, OpenSSL 1.0.2j  26 Sep 2016    iMac:~ Luca$ ssh -p 53 -D 9999 luca@myIP  luca@myIP's password:   luca@ns3274305:~$ ssh_dispatch_run_fatal: Connection to myIP port 53: message authentication code incorrect    iMac:~ Luca$ ssh -o macs=hmac-sha1 -p 53 -D 9999 luca@myIP  luca@myIP's password:   luca@ns3274305:~$ ssh_dispatch_run_fatal: Connection to myIP port 53: message authentication code incorrect  iMac:~ Luca$  

install X11 libraries and header files in user account centOS

Posted: 27 May 2021 08:05 AM PDT

I would like to install X11 libraries and header files in my own account (not root) for further use.

What other libs do I need to install for that? Where can I find the source codes and installation guide?

Truely, I want to install "ncview" software (http://meteora.ucsd.edu/~pierce/ncview_home_page.html) in my centOS linux. In the root, the system does not contain "X11" in the /usr/include. So, I want to install it in my own account.

Thanks for looking into it.

Kerberos/Samba can't join Active Directory [DEBIAN 8]

Posted: 27 May 2021 09:04 AM PDT

I have an issue when I try to join my domain.

I am able to create the kerberos ticket successfully.

root@debian:~# kinit Administrateur@ASP.DOMAIN  Password for Administrateur@ASP.DOMAIN:  root@debian:~# klist  Ticket cache: FILE:/tmp/krb5cc_0  Default principal: Administrateur@ASP.DOMAIN    Valid starting       Expires              Service principal  26/04/2016 18:20:18  27/04/2016 04:20:18  krbtgt/ASP.DOMAIN@ASP.DOMAIN          renew until 27/04/2016 18:20:11  

and when I try to join the domain :

    root@debian:~# net ads join -k   Failed to join domain: failed to lookup      DC info for domain 'ASP.DOMAIN' over rpc: {Device Timeout} The      specified I/O operation on %hs was not completed before the time-out period expired.  

my krb5.conf is:

[libdefaults]          default_realm = ASP.DOMAIN    # The following krb5.conf variables are only for MIT Kerberos.          krb4_config = /etc/krb.conf          krb4_realms = /etc/krb.realms          kdc_timesync = 1          ccache_type = 4          forwardable = true          proxiable = true    [realms]          ASP.DOMAIN = {                  kdc = asp.domain                  admin_server = server.domain                  default_domain = DOMAIN          }    [domain_realm]          .asp.domain = ASP.DOMAIN          asp.domain = ASP.DOMAIN  

My smb.conf :

[global]          security = ADS          realm = ASP.DOMAIN          password server = server.domain          workgroup = asp.domain          winbind separator = /          idmap uid = 10000-20000          idmap gid = 10000-20000          winbind enum users = yes          winbind enum groups = yes          template homedir = /home/%D/%U          template shell = /bin/bash          client use spnego = yes          winbind use default domain = yes          domain master = no          local master = no          preferred master = no          os level = 0  

I have no idea: there is no drop on my firewall. The ticket is ok. I've tried with 3 Domain Controlers.

PS : Domain is a variable

EDIT : I've tried to do it with samba-tool too

root@debian:~# samba-tool domain join ASP.DOMAIN MEMBER -UAdministrateur --real=ASP.DOMAIN  ERROR(runtime): uncaught exception - Connection to SAMR pipe of PDC for ASP.DOMAIN failed: Connection to DC failed: NT_STATUS_IO_TIMEOUT    File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 175, in _run      return self.run(*args, **kwargs)    File "/usr/lib/python2.7/dist-packages/samba/netcmd/domain.py", line 606, in run      machinepass=machinepass)  

EDIT 2 : Join is ok ? But wbinfo -u is not ok

root@debian:~# net ads join -U Administrateur  Enter Administrateur's password:  Using short domain name -- DOMAIN  Joined 'ASP.DOMAIN' to dns domain 'asp.domain'  DNS Update for asp.kapia failed: ERROR_DNS_GSS_ERROR  DNS update failed: NT_STATUS_UNSUCCESSFUL  root@debian:~# net ads testjoin  Join is OK    root@debian:~# wbinfo -u  could not obtain winbind interface details: WBC_ERR_WINBIND_NOT_AVAILABLE  could not obtain winbind domain name!  Error looking up domain users  

EDIT 3 :

enter image description here EDIT 4 :

root@debian:~# service winbind status  ● winbind.service - LSB: start Winbind daemon     Loaded: loaded (/etc/init.d/winbind)     Active: active (exited) since mer. 2016-04-27 16:16:00 CEST; 55s ago    Process: 2222 ExecStart=/etc/init.d/winbind start (code=exited, status=0/SUCCESS)    avril 27 16:16:00 debian winbindd[2233]: #5 /usr/lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_timer_delay+0xcd) [0x7fbc2b11e1cd]  avril 27 16:16:00 debian winbindd[2233]: #6 /usr/lib/x86_64-linux-gnu/libtevent.so.0(+0x91ca) [0x7fbc2b11f1ca]  avril 27 16:16:00 debian winbindd[2233]: #7 /usr/lib/x86_64-linux-gnu/libtevent.so.0(+0x78e7) [0x7fbc2b11d8e7]  avril 27 16:16:00 debian winbindd[2233]: #8 /usr/lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x8d) [0x7fbc2b11a12d]  avril 27 16:16:00 debian winbindd[2233]: #9 /usr/sbin/winbindd(main+0xb7c) [0x7fbc325cbc8c]  avril 27 16:16:00 debian winbindd[2233]: #10 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fbc2a92db45]  avril 27 16:16:00 debian winbindd[2233]: #11 /usr/sbin/winbindd(+0x25318) [0x7fbc325cc318]  avril 27 16:16:00 debian winbindd[2233]: [2016/04/27 16:16:00.971185,  0] ../source3/lib/dumpcore.c:318(dump_core)  avril 27 16:16:00 debian winbindd[2233]: dumping core in /var/log/samba/cores/winbindd  avril 27 16:16:00 debian winbindd[2233]:  

What does it mean to set a terminal's "icon title"?

Posted: 27 May 2021 07:25 AM PDT

I generally see the syntax for setting the terminal title as (something like):

echo -e '\e]0;Some Title\a'  

But I noticed this answer used 2 instead of 0, which prompted me to do a little more digging. According to this document you can actually set both the "icon name" and the "window title" with this syntax:

·  ESC]0;stringBEL -- Set icon name and window title to string    ·  ESC]1;stringBEL -- Set icon name to string    ·  ESC]2;stringBEL -- Set window title to string       where ESC is the escape character (\033), and BEL is the bell     character (\007).    Printing one of these sequences within the xterm will cause the window  or icon title to be changed.  

But it doesn't go on to explain what exactly it means by "icon title" or "icon name". When I try it out I don't see any difference between 0 and 2, and 1 doesn't appear to do anything.

So what is the "icon title", and what is supposed to happen when 0 or 1 is called?

Unable to start vncserver in RHEL 7

Posted: 27 May 2021 10:30 AM PDT

Following the instructions from Redhat documentation (TigerVNC), I've installed VNCserver in RHEL 7. When I try to start the vncserver service, it returns an error

#systemctl start vncserver@:1.service  Job for vncserver@:1.service failed. See 'systemctl status vncserver@:1.service' and 'journalctl -xn' for details.  

I found the status of the vncserver as:

vncserver@:1.service - Remote desktop service (VNC)     Loaded: loaded (/etc/systemd/system/vncserver@.service; disabled)     Active: failed (Result: exit-code) since Thu 2015-10-22 14:35:57 EDT; 13s ago    Process: 6640 ExecStart=/sbin/runuser -l MyUser -c /usr/bin/vncserver %i -geometry 1280x1024 (code=exited, status=98)    Process: 6637 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)  systemd[1]: vncserver@:1.service: control process exited, code=exited status=98  systemd[1]: Failed to start Remote desktop service (VNC).  systemd[1]: Unit vncserver@:1.service entered failed state.  

Updated the users in vncserver@.service file and have reloaded the daemon. Any ideas on how to resolve this.

Replicate a complex partition structure with LUKS and LVM volumes

Posted: 27 May 2021 08:31 AM PDT

I have two external hard discs on an OpenSUSE 13.1 system.

On one I have created a partition structure:

  1. An encrypted LVM partition (LUKS)
  2. Several volumes (10) on this LVM partition, some formatted with xfs, some with ext4.
sdf                              8:80   0   5,5T  0 disk    └─sdf1                           8:81   0   5,5T  0 part      └─extern-2-crypt             253:5    0   5,5T  0 crypt       ├─extern--2-nelson--home   253:10   0     8G  0 lvm   /extern/nelson/home      ├─extern--2-lucien--boot   253:11   0   300M  0 lvm   /extern/lucien/boot      ├─extern--2-nelson--root   253:12   0  11,5G  0 lvm   /extern/nelson/root      ├─extern--2-nelson--space  253:13   0  90,1G  0 lvm   /extern/nelson/space      ├─extern--2-lucien--backup 253:14   0   400G  0 lvm   /extern/lucien/backup      ├─extern--2-lucien--home   253:15   0    20G  0 lvm   /extern/lucien/home      ├─extern--2-lucien--raid   253:16   0   3,5T  0 lvm   /extern/lucien/raid      ├─extern--2-lucien--root   253:17   0   8,5G  0 lvm   /extern/lucien/root      └─extern--2-lucien--space  253:18   0    30G  0 lvm   /extern/lucien/space  

How can I replicate this structure easily including the LVM config from one disc to the other (with only one disc running at the same time)?

I know of sgdisk (8) and parted (mentioned in How to copy the partition layout of a whole disk using standard tools), but that covers only the partition, not the LUKS information and certainly not the LVM config.

How to add a key binding to maximize/close all windows?

Posted: 27 May 2021 10:01 AM PDT

Lubuntu uses LXDE with Openbox. I can configure key bindings in ~/.config/openbox/lubuntu-rc.xml

I want to add key bindings to maximize all windows and have the current active one on top.

I also need to have a key binding to close all windows.

Example

<keybind key="KP_Prior">    <action name="Execute">      <startupnotify>        <enabled>true</enabled>        <name>File manager</name>      </startupnotify>      <command>lxsession-default file_manager</command>    </action>  </keybind>  

How to have tail -f show colored output

Posted: 27 May 2021 08:19 AM PDT

I'd like to be able to tail the output of a server log file that has messages like:

INFO  SEVERE  

etc, and if it's SEVERE, show the line in red; if it's INFO, in green. What kind of alias can I setup for a tail command that would help me do this?

No comments:

Post a Comment