Sunday, June 12, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Dumb terminal agetty keyboard layout filter

Posted: 12 Jun 2022 03:13 PM PDT

I recently acquired an old Heathkit dumb terminal, and I would like to get it working with the colemak keyboard layout. Because the terminal sends ascii codes directly over serial, I don't believe anything like loadkeys will work. (If there is a simple solution to changing the layout, I'd love to know.)

My current plan is to filter every byte that is received or transmitted in a simple piece of software. There are also a few command line programs that still use incompatible escape codes (despite TERM being set correctly) which I would like to manually filter out as well.

Essentially I'd like to create a program that sits between agetty and the terminal and allows me to filter bytes manually as they are sent or received.

The filtering of bytes is simple enough, but I'm unsure how to create an interface to agetty that can do this. Will I need to create my own device using mknod?

(I've also considered using a microcontroller or raspberry pi sitting between the terminal and linux machine to read bytes in and write the new bytes out. This solution would be clunky and I'd like to avoid it if possible.)

Any advice on where to look/read would be extremely helpful.

DHCP keeps stopping

Posted: 12 Jun 2022 02:44 PM PDT

On my rasbperry pi (4b 8GB version) DHCP keeps stopping seemingly at random. I can restart it from the terminal (sudo dhcpcd) and it works fine, for a while, and then it stops again. What might be causing this and how can I fix it?

Distribution: Raspbian OS 10 (Debian Stretch-based, I believe)
DHCPCD version: 8.1.2
Compiled features: INET ARP ARPing IPv4LL INET6 HHCPv6 AUTH
I have no modified the config file at all, this is a fresh installation of Raspbian

FLAC encoders – any difference in output between the command-line tools?

Posted: 12 Jun 2022 01:01 PM PDT

I would like to know if there is any difference in the final output between the various command-line tools for encoding FLAC files, like ffmpeg, sox, the "official" flac etc. In some contexts, I have noticed that it's recommended to use flac over the others, but given that FLAC represents lossless encoding, am I correct in assuming that they should all produce identical output (given the same options)?

How to add brew command permantly to path in linux(deepin os). Right i use the commnds below

Posted: 12 Jun 2022 12:34 PM PDT

echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/laya/.profile eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" I have to exeute this commands all the time i want to use the brew. How do i add them permantly to my path

What's wrong with my elif statement in this casino/hotel game I'm making? [duplicate]

Posted: 12 Jun 2022 01:38 PM PDT

I enter code like the following:

#!/bin/bash    echo "text1"  read bookaroom  if [ bookaroom=="yes" ]; then      echo "text2"      read roomtype  elif [ bookaroom=="no" ]; then      echo "text3"  else      echo "text4"  fi  

and no matter what, it never displays text3 or text4 when I run the program. I have tried several different things such as setting "yes" and "no" to be variables instead, reading bookaroom like this:

read -p "text1" bookaroom  

and just going through the code retrying different things until they work, which they didn't, and nothing seems to be working. I have researched several times the syntax and have found that I have the correct syntax.

What are the detriments of not setting MSFTDATA flag when making a exFAT partition?

Posted: 12 Jun 2022 12:21 PM PDT

I have several external HDDs that I backup data to and occasionally plugin internally when I need access to the data.

I erased all partitions by making a new GPT partition table on the disk. I made a primary partition of type NTFS and then formatted as an exFAT partition:

parted mkpart primary NTFS 0% 100%  mkfs.exfat /dev/sdb1  

Now, I can plug this HDD into both my Unix desktop and Windows desktop and can access the files without issue.

However, I noticed that my Windows partitions have MSFTDATA flag set when viewed in parted (parted print all).

I haven't set this flag - will this become an issue later and will setting the flag cause issues accessing the data from Unix? What exactly does Windows (or Unix) use this flag for?

VT100 Escape codes and TTY interaction: Why `open` a TTY device as opposed to using stdin/stdout

Posted: 12 Jun 2022 01:45 PM PDT

I had a look into escape codes and found some C code that reads the current cursor position. And I guess I have now stumbled over a topic of UNIX/POSIX programming I until now had not much exposure to.

The below code opens dev/tty in read-write mode and writes the appropriate escape code to the file-descriptor, then receives the answer by reading from the file-descriptor. so programmatically I understand whats going on.

Conceptionally I wonder

  1. Why is the TTY device opened (as opposed to stdin/stdout usage)
  2. If I open a TTY device, wouldn't I have to first find out the current tty (by opening a pipe to /usr/bin/tty for example, then opening this device).
#include <errno.h>  #include <fcntl.h>  #include <stdio.h>  #include <stdlib.h>  #include <string.h>  #include <unistd.h>    int main(void) {    int tty_fd = open("/dev/tty", O_RDWR);    if (tty_fd < 0) {      printf("Cannot open /devv/tty: errno = %d, %s\r\n", errno, strerror(errno));      exit(EXIT_FAILURE);    }      write(tty_fd, "\x1B[6n\n", 5);      unsigned char res[16] = {0};    size_t j = 0;    for (j = 0; j < sizeof(res) - 1 && read(tty_fd, res + j, 1) == 1; j++) {      printf("%d\n", res[j]);      if (res[j] == 'R') {        break;        res[j] = '\0';      }    }      printf("Answerback = %s", res + 1);      return 0;  }  

Why does libvirt-daemon-system have so many dependencies on Debian?

Posted: 12 Jun 2022 12:05 PM PDT

On my headless debian 11 (bullseye) server, when I attempt to install libvirt-daemon-system, apt threatens to basically install an entire graphical environment, including audio libraries and everything:

mic@micserver:~$ sudo apt install libvirt-daemon-system  Reading package lists... Done  Building dependency tree... Done  Reading state information... Done  The following additional packages will be installed:    adwaita-icon-theme alsa-topology-conf alsa-ucm-conf at-spi2-core augeas-lenses dbus-user-session dconf-gsettings-backend dconf-service fontconfig glib-networking glib-networking-common    glib-networking-services gsettings-desktop-schemas gstreamer1.0-libav gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-x gtk-update-icon-cache hicolor-icon-theme i965-va-driver    ibverbs-providers intel-media-va-driver ipxe-qemu jq libaa1 libaacs0 libasound2 libasound2-data libass9 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libaugeas0 libavc1394-0    libavcodec58 libavfilter7 libavformat58 libavutil56 libbdplus0 libbluray2 libbrlapi0.8 libbs2b0 libcaca0 libcacard0 libcairo-gobject2 libcairo2 libcapstone4 libcdparanoia0 libchromaprint1 libcodec2-0.9    libcolord2 libdatrie1 libdaxctl1 libdconf1 libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libdv4 libdw1 libepoxy0 libexecs0 libfdt1 libflac8 libflite1 libfribidi0 libgbm1    libgdk-pixbuf-2.0-0 libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgfortran5 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libgme0 libgraphite2-3 libgsm1 libgstreamer-plugins-base1.0-0    libgstreamer1.0-0 libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0 libharfbuzz0b libibverbs1 libiec61883-0 libigdgmm11 libjack-jackd2-0 libjq1 libjson-glib-1.0-0 libjson-glib-1.0-common liblapack3    liblilv-0-0 libmfx1 libmp3lame0 libmpg123-0 libmysofa1 libndctl6 libnetcf1 libnl-route-3-200 libnorm1 libogg0 libopenmpt0 libopus0 liborc-0.4-0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libparted2    libpciaccess0 libpgm-5.3-0 libpixman-1-0 libpmem1 libpocketsphinx3 libpolkit-agent-1-0 libpolkit-gobject-1-0 libpostproc55 libproxy1v5 libpulse0 libquadmath0 librabbitmq4 libraw1394-11 librdmacm1    librest-0.7-0 librsvg2-2 librsvg2-common librubberband2 libsamplerate0 libserd-0-0 libshine3 libshout3 libslirp0 libsndfile1 libsord-0-0 libsoup-gnome2.4-1 libsoup2.4-1 libsoxr0 libspeex1 libsphinxbase3    libspice-server1 libsratom-0-0 libsrt1.4-gnutls libssh-gcrypt-4 libswresample3 libswscale5 libtag1v5 libtag1v5-vanilla libthai-data libthai0 libtheora0 libtwolame0 libudfread0 libunwind8 liburing1    libusbredirparser1 libv4l-0 libv4lconvert0 libva-drm2 libva-x11-2 libva2 libvdeplug2 libvdpau-va-gl1 libvdpau1 libvidstab1.1 libvirglrenderer1 libvirt-clients libvirt-daemon libvirt-daemon-config-network    libvirt-daemon-config-nwfilter libvirt-daemon-driver-lxc libvirt-daemon-driver-vbox libvirt-daemon-driver-xen libvisual-0.4-0 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx6 libvte-2.91-0 libvte-2.91-common    libvulkan1 libwavpack1 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0 libx11-xcb1 libx264-160 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-render0    libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcomposite1 libxcursor1 libxdamage1 libxencall1 libxendevicemodel1 libxenevtchn1 libxenforeignmemory1 libxengnttab1 libxenhypfs1 libxenmisc4.14 libxenstore3.0    libxentoolcore1 libxentoollog1 libxfixes3 libxinerama1 libxkbcommon0 libxml2-utils libxrandr2 libxshmfence1 libxv1 libxvidcore4 libxxf86vm1 libzmq5 libzvbi-common libzvbi0 mdevctl mesa-va-drivers    mesa-vdpau-drivers mesa-vulkan-drivers ocl-icd-libopencl1 ovmf parted pocketsphinx-en-us policykit-1 qemu-system-common qemu-system-data qemu-system-gui qemu-system-x86 qemu-utils seabios va-driver-all    vdpau-driver-all  

I don't understand where this is coming from, though. Looking at apt-cache dependencies, the package seems much more sane:

mic@micserver:~$ apt-cache depends libvirt-daemon-system  libvirt-daemon-system    Depends: adduser    Depends: gettext-base   |Depends: iptables    Depends: firewalld    Depends: libvirt-clients    Depends: libvirt-daemon    Depends: libvirt-daemon-config-network    Depends: libvirt-daemon-config-nwfilter   |Depends: libvirt-daemon-system-systemd    Depends: libvirt-daemon-system-sysv    Depends: logrotate    Depends: policykit-1   |Depends: debconf    Depends: <debconf-2.0>      cdebconf      debconf    Breaks: systemd-sysv    Recommends: dmidecode    Recommends: dnsmasq-base    Recommends: iproute2    Recommends: mdevctl    Recommends: parted    Suggests: apparmor    Suggests: auditd    Suggests: nfs-common    Suggests: open-iscsi    Suggests: pm-utils    Suggests: radvd    Suggests: systemd    Suggests: systemtap    Suggests: <zfsutils>  

Can these dependencies be avoided?

Linux memory allocation for user's process (buddy allocator)

Posted: 12 Jun 2022 10:52 AM PDT

I'm studying memory allocation in Linux and I have a question about the buddy allocator. Reading the documentation available on kernel.org I've learn that the buddy allocator is responsible for the allocation of physical pages (through the __alloc_pages() function).

I'm wondering if the buddy system (and the __alloc_pages() function) is involved in the allocation of pages to user's processes, or if it allocates pages only for kernel's processes.

Summing up, my question is: if a user's process needs to be loaded into the physical memory, the buddy allocator is involved?

Change cgroups pids.max value but the processes are not limited

Posted: 12 Jun 2022 10:21 AM PDT

I changed the file cgroup pids.max (for limiting child processes), but the processes are not limited. Anyone has idea way?

Thanks!

Terminology: terminal command to be invoked from any directory?

Posted: 12 Jun 2022 10:14 AM PDT

Context: macOS Catalina zSh. The end goal is to be able to setup user scripts so that they can be invoked via CLI at an arbitrary data location.

Question: What is the word (Terminology) for: the terminal command to be invoked from any directory? The correct word / phrase would allow me to Google the subject matter and inch forward to the goal defined below.

Example: the command ls can be issued from any directory and return output. Likewise when lsusb was installed with homebrew: lsusb will work from any directory: somehow when lsusb was installed, the system was configured such that it knows where to look to find lsusb.

Path Variable: I understand that the $PATH variable contains path information:

babygrand:~ user$ echo $PATH

returns

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

I suspect that /etc/paths is configures $PATH at startup:

babygrand:~ user$ cat /etc/paths

/usr/local/bin /usr/bin /bin /usr/sbin /sbin

The output paths seem to be a variation of the File System Hierarchy, which poses a similar question to my goal, but not my Terminology question

GOAL: I would like to Google the word / term of the subject matter and learn best practice how to enable a script to be run from any directory. I am faced with a decision as to whether to add another path or to choose an one of the above existing paths that has been already configured into the $PATH variable.

The ability to invoke my script at an arbitrary directory is of significant utility: the script performs work on pdf files, which could be located anywhere in the file system. My script calls an executable to stamp pdf documents.

Clarification: The subject matter is not that of the "subfolder" problem posed at: https://apple.stackexchange.com/q/366127/187540 This is excellent reading as it is somewhat related to directory management.

What is the difference in how linux implements commands which accept input via pipe vs. command arguments?

Posted: 12 Jun 2022 11:32 AM PDT

Although there are many similar questions, I cannot find one that directly answers my question. I understand the basics of OS memory management, processes, communication between processes, etc. However, it is not obvious to me the fundamental difference between the implementation of commands that can receive input via pipes and those that can only accept command arguments.

Why would a command accept input via one method but not the other, and how can one can easily tell which input method a command accepts?

As a trivial example, why can I pipe the filenames output by ls to cat for display, but cannot do the same for rm? Is there a philosophical reason, deep technical reason, or arbitrary choice in implementation that drives this difference in behavior?

ls | cat  delete_me_1.txt  delete_me_2.txt    ls | rm  rm: missing operand  

Asked differently, if I am writing a linux command, what technical factors do I need to consider to choose whether to accept command input via pipe, command arguments, or both?

less command: b/f vs w/s

Posted: 12 Jun 2022 03:28 PM PDT

About the less and according with:

indicates the following:

f ^F ^V SPACE * Forward one window (or N lines).  b ^B ESC-v *    Backward one window (or N lines).  z * Forward one window (and set window to N).  w * Backward one window (and set window to N).  

Enabling the line numbers - with -N - for example for man less itself, I can see that b/f works/behaves the same than w/z it about the amount of content/lines moved up/down by either window or page.

Question

  • What is the difference between b/f vs w/z?

normally I use the first pair, but when use the second pair?

Extra Question

  • What does and set window to N mean?

I am assuming it is the expected difference that makes w/z different against b/f

chroot as unpriviledged user leads to 'Permission denied' trying to run any binary

Posted: 12 Jun 2022 10:39 AM PDT

I have a chroot root containing some static binaries on an ARMv7l platform (Kobo eReader, see InkBox OS project), namely BusyBox. chrooting as root works fine:

kobo:/kobo/mnt/onboard/onboard/.apps/Sanki# env PATH=/system-bin /tmp/chroot /data/onboard/.apps/Sanki/ /app-temp/busybox sh  kobo:/# whoami  whoami: unknown uid 0 #### I am root  kobo:/#  

then I tried to login as an unpriviledged user in the chroot via the --userspec option:

kobo:/kobo/mnt/onboard/onboard/.apps/Sanki# env PATH=/system-bin /tmp/chroot --userspec=user:user /data/onboard/.apps/Sanki/ /app-temp/busybox sh  chroot: failed to run command '/app-temp/busybox': Permission denied  kobo:/kobo/mnt/onboard/onboard/.apps/Sanki#  

Stack trace:

kobo:/kobo/mnt/onboard/onboard/.apps/Sanki# strace env PATH=/system-bin /tmp/chroot --userspec=user:user /data/onboard/.apps/Sanki/ /system-bin/busybox sh  execve("/usr/bin/env", ["env", "PATH=/system-bin", "/tmp/chroot", "--userspec=user:user", "/data/onboard/.apps/Sanki/", "/system-bin/busybox", "sh"], 0x7e8f5cf8 /* 17 vars */) = 0  set_tls(0x2ad13388)                     = 0  set_tid_address(0x2ad13f3c)             = 3925  brk(NULL)                               = 0x2abcd000  brk(0x2abcf000)                         = 0x2abcf000  mmap2(0x2abcd000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2abcd000  open("/etc/ld-musl-armhf.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)  open("/lib/libacl.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7eafe5f8) = -1 ENOSYS (Function not implemented)  fstat64(3, {st_mode=S_IFREG|0755, st_size=17616, ...}) = 0  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0h\22\0\0004\0\0\0"..., 936) = 936  mmap2(NULL, 86016, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2abcf000  mmap2(0x2abe2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x3000) = 0x2abe2000  close(3)                                = 0  open("/lib/libattr.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7eafe5f8) = -1 ENOSYS (Function not implemented)  fstat64(3, {st_mode=S_IFREG|0755, st_size=13480, ...}) = 0  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\320\r\0\0004\0\0\0"..., 936) = 936  mmap2(NULL, 81920, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2abe4000  mmap2(0x2abf6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x2abf6000  close(3)                                = 0  mprotect(0x2abe2000, 4096, PROT_READ)   = 0  mprotect(0x2abf6000, 4096, PROT_READ)   = 0  mprotect(0x2abb5000, 24576, PROT_READ)  = 0  prctl(PR_SET_NAME, "env")               = 0  prctl(PR_SET_KEEPCAPS, 2125458926)      = -1 EINVAL (Invalid argument)  execve("/tmp/chroot", ["/tmp/chroot", "--userspec=user:user", "/data/onboard/.apps/Sanki/", "/system-bin/busybox", "sh"], 0x7eafecf4 /* 17 vars */) = 0  set_tls(0x2acff388)                     = 0  set_tid_address(0x2acfff3c)             = 3925  brk(NULL)                               = 0x2ac75000  brk(0x2ac77000)                         = 0x2ac75000  mmap2(NULL, 8192, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab4b000  mprotect(0x2ab4c000, 4096, PROT_READ|PROT_WRITE) = 0  open("/etc/ld-musl-armhf.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)  open("/lib/libacl.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7e811648) = -1 ENOSYS (Function not implemented)  fstat64(3, {st_mode=S_IFREG|0755, st_size=17616, ...}) = 0  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0h\22\0\0004\0\0\0"..., 936) = 936  mmap2(NULL, 86016, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2ad00000  mmap2(0x2ad13000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x3000) = 0x2ad13000  close(3)                                = 0  open("/lib/libattr.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7e811648) = -1 ENOSYS (Function not implemented)  fstat64(3, {st_mode=S_IFREG|0755, st_size=13480, ...}) = 0  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\320\r\0\0004\0\0\0"..., 936) = 936  mmap2(NULL, 81920, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2aaf1000  mmap2(0x2ab03000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x2ab03000  close(3)                                = 0  mprotect(0x2ad13000, 4096, PROT_READ)   = 0  mprotect(0x2ab03000, 4096, PROT_READ)   = 0  mprotect(0x2ac5d000, 24576, PROT_READ)  = 0  prctl(PR_SET_NAME, "/tmp/chroot")       = 0  prctl(PR_SET_KEEPCAPS, 2122391093)      = -1 EINVAL (Invalid argument)  mmap2(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaec000  statx(AT_FDCWD, "/data", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_BASIC_STATS, 0x7e8119b0) = -1 ENOSYS (Function not implemented)  lstat64("/data", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0  statx(AT_FDCWD, "/data/onboard", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_BASIC_STATS, 0x7e8119b0) = -1 ENOSYS (Function not implemented)  lstat64("/data/onboard", {st_mode=S_IFDIR|0755, st_size=6656, ...}) = 0  statx(AT_FDCWD, "/data/onboard/.apps", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_BASIC_STATS, 0x7e8119b0) = -1 ENOSYS (Function not implemented)  lstat64("/data/onboard/.apps", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0  statx(AT_FDCWD, "/data/onboard/.apps/Sanki", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_BASIC_STATS, 0x7e8119b0) = -1 ENOSYS (Function not implemented)  lstat64("/data/onboard/.apps/Sanki", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0  munmap(0x2aaec000, 16384)               = 0  open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aac0000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "root:x:0:0:root:/root:/bin/ash\nb"..., 1024) = 1024  read(3, "mail:/sbin/nologin\nntp:x:123:123"..., 1024) = 302  close(3)                                = 0  munmap(0x2aac0000, 4096)                = 0  open("/etc/group", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac4d000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "root:x:0:root\nbin:x:1:root,bin,d"..., 1024) = 730  close(3)                                = 0  munmap(0x2ac4d000, 4096)                = 0  open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab7d000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "root:x:0:0:root:/root:/bin/ash\nb"..., 1024) = 1024  read(3, "mail:/sbin/nologin\nntp:x:123:123"..., 1024) = 302  close(3)                                = 0  munmap(0x2ab7d000, 4096)                = 0  socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aac7000  connect(3, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 24) = -1 ENOENT (No such file or directory)  close(3)                                = 0  munmap(0x2aac7000, 4096)                = 0  open("/etc/group", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aacc000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "root:x:0:root\nbin:x:1:root,bin,d"..., 1024) = 730  read(3, "", 1024)                       = 0  close(3)                                = 0  munmap(0x2aacc000, 4096)                = 0  chroot("/data/onboard/.apps/Sanki/")    = 0  chdir("/")                              = 0  open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aacd000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "user::1000:1000:user:/root:/syst"..., 1024) = 42  close(3)                                = 0  munmap(0x2aacd000, 4096)                = 0  open("/etc/group", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab7e000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "user:x:1000:\n", 1024)         = 13  close(3)                                = 0  munmap(0x2ab7e000, 4096)                = 0  open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac4d000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "user::1000:1000:user:/root:/syst"..., 1024) = 42  close(3)                                = 0  munmap(0x2ac4d000, 4096)                = 0  socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac4d000  connect(3, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 24) = -1 ENOENT (No such file or directory)  close(3)                                = 0  munmap(0x2ac4d000, 4096)                = 0  open("/etc/group", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab0b000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "user:x:1000:\n", 1024)         = 13  read(3, "", 1024)                       = 0  close(3)                                = 0  munmap(0x2ab0b000, 4096)                = 0  rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[], NULL, 8) = 0  setgroups32(1, [1000])                  = 0  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[], NULL, 8) = 0  setgid32(1000)                          = 0  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[], NULL, 8) = 0  setuid32(1000)                          = 0  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0  execve("/system-bin/busybox", ["/system-bin/busybox", "sh"], 0x7e811d3c /* 17 vars */) = -1 EACCES (Permission denied)  fcntl64(1, F_GETFL)                     = 0x20002 (flags O_RDWR|O_LARGEFILE)  writev(2, [{iov_base="chroot: ", iov_len=8}, {iov_base=NULL, iov_len=0}], 2chroot: ) = 8  writev(2, [{iov_base="failed to run command \342\200\230/system"..., iov_len=47}, {iov_base=NULL, iov_len=0}], 2failed to run command '/system-bin/busybox') = 47  writev(2, [{iov_base=": Permission denied", iov_len=19}, {iov_base=NULL, iov_len=0}], 2: Permission denied) = 19  writev(2, [{iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 2  ) = 1  close(1)                                = 0  close(2)                                = 0  exit_group(126)                         = ?  +++ exited with 126 +++  kobo:/kobo/mnt/onboard/onboard/.apps/Sanki# strace env PATH=/system-bin /tmp/chroot --userspec=user:user /data/onboard/.apps/Sanki/ /app-temp/busybox sh  execve("/usr/bin/env", ["env", "PATH=/system-bin", "/tmp/chroot", "--userspec=user:user", "/data/onboard/.apps/Sanki/", "/app-temp/busybox", "sh"], 0x7ec2bcf8 /* 17 vars */) = 0  set_tls(0x2ad36388)                     = 0  set_tid_address(0x2ad36f3c)             = 3929  brk(NULL)                               = 0x2abef000  brk(0x2abf1000)                         = 0x2abf1000  mmap2(0x2abef000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2abef000  open("/etc/ld-musl-armhf.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)  open("/lib/libacl.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7ebfe608) = -1 ENOSYS (Function not implemented)  fstat64(3, {st_mode=S_IFREG|0755, st_size=17616, ...}) = 0  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0h\22\0\0004\0\0\0"..., 936) = 936  mmap2(NULL, 86016, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2abf1000  mmap2(0x2ac04000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x3000) = 0x2ac04000  close(3)                                = 0  open("/lib/libattr.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7ebfe608) = -1 ENOSYS (Function not implemented)  fstat64(3, {st_mode=S_IFREG|0755, st_size=13480, ...}) = 0  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\320\r\0\0004\0\0\0"..., 936) = 936  mmap2(NULL, 81920, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2ac06000  mmap2(0x2ac18000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x2ac18000  close(3)                                = 0  mprotect(0x2ac04000, 4096, PROT_READ)   = 0  mprotect(0x2ac18000, 4096, PROT_READ)   = 0  mprotect(0x2abd7000, 24576, PROT_READ)  = 0  prctl(PR_SET_NAME, "env")               = 0  prctl(PR_SET_KEEPCAPS, 2126507504)      = -1 EINVAL (Invalid argument)  execve("/tmp/chroot", ["/tmp/chroot", "--userspec=user:user", "/data/onboard/.apps/Sanki/", "/app-temp/busybox", "sh"], 0x7ebfed04 /* 17 vars */) = 0  set_tls(0x2ad7d388)                     = 0  set_tid_address(0x2ad7df3c)             = 3929  brk(NULL)                               = 0x2ac45000  brk(0x2ac47000)                         = 0x2ac47000  mmap2(0x2ac45000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2ac45000  open("/etc/ld-musl-armhf.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)  open("/lib/libacl.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7eab9648) = -1 ENOSYS (Function not implemented)  fstat64(3, {st_mode=S_IFREG|0755, st_size=17616, ...}) = 0  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0h\22\0\0004\0\0\0"..., 936) = 936  mmap2(NULL, 86016, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2ab0a000  mmap2(0x2ab1d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x3000) = 0x2ab1d000  close(3)                                = 0  open("/lib/libattr.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7eab9648) = -1 ENOSYS (Function not implemented)  fstat64(3, {st_mode=S_IFREG|0755, st_size=13480, ...}) = 0  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\320\r\0\0004\0\0\0"..., 936) = 936  mmap2(NULL, 81920, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2aab3000  mmap2(0x2aac5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x2aac5000  close(3)                                = 0  mprotect(0x2ab1d000, 4096, PROT_READ)   = 0  mprotect(0x2aac5000, 4096, PROT_READ)   = 0  mprotect(0x2ac2d000, 24576, PROT_READ)  = 0  prctl(PR_SET_NAME, "/tmp/chroot")       = 0  prctl(PR_SET_KEEPCAPS, 2125176375)      = -1 EINVAL (Invalid argument)  mmap2(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab1f000  statx(AT_FDCWD, "/data", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_BASIC_STATS, 0x7eab99b0) = -1 ENOSYS (Function not implemented)  lstat64("/data", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0  statx(AT_FDCWD, "/data/onboard", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_BASIC_STATS, 0x7eab99b0) = -1 ENOSYS (Function not implemented)  lstat64("/data/onboard", {st_mode=S_IFDIR|0755, st_size=6656, ...}) = 0  statx(AT_FDCWD, "/data/onboard/.apps", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_BASIC_STATS, 0x7eab99b0) = -1 ENOSYS (Function not implemented)  lstat64("/data/onboard/.apps", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0  statx(AT_FDCWD, "/data/onboard/.apps/Sanki", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_BASIC_STATS, 0x7eab99b0) = -1 ENOSYS (Function not implemented)  lstat64("/data/onboard/.apps/Sanki", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0  munmap(0x2ab1f000, 16384)               = 0  open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aad1000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "root:x:0:0:root:/root:/bin/ash\nb"..., 1024) = 1024  read(3, "mail:/sbin/nologin\nntp:x:123:123"..., 1024) = 302  close(3)                                = 0  munmap(0x2aad1000, 4096)                = 0  open("/etc/group", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aad2000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "root:x:0:root\nbin:x:1:root,bin,d"..., 1024) = 730  close(3)                                = 0  munmap(0x2aad2000, 4096)                = 0  open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aad4000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "root:x:0:0:root:/root:/bin/ash\nb"..., 1024) = 1024  read(3, "mail:/sbin/nologin\nntp:x:123:123"..., 1024) = 302  close(3)                                = 0  munmap(0x2aad4000, 4096)                = 0  socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac1d000  connect(3, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 24) = -1 ENOENT (No such file or directory)  close(3)                                = 0  munmap(0x2ac1d000, 4096)                = 0  open("/etc/group", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab47000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "root:x:0:root\nbin:x:1:root,bin,d"..., 1024) = 730  read(3, "", 1024)                       = 0  close(3)                                = 0  munmap(0x2ab47000, 4096)                = 0  chroot("/data/onboard/.apps/Sanki/")    = 0  chdir("/")                              = 0  open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aac8000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "user::1000:1000:user:/root:/syst"..., 1024) = 42  close(3)                                = 0  munmap(0x2aac8000, 4096)                = 0  open("/etc/group", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac1d000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "user:x:1000:\n", 1024)         = 13  close(3)                                = 0  munmap(0x2ac1d000, 4096)                = 0  open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab3c000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "user::1000:1000:user:/root:/syst"..., 1024) = 42  close(3)                                = 0  munmap(0x2ab3c000, 4096)                = 0  socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac1d000  connect(3, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 24) = -1 ENOENT (No such file or directory)  close(3)                                = 0  munmap(0x2ac1d000, 4096)                = 0  open("/etc/group", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaf2000  fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0  read(3, "user:x:1000:\n", 1024)         = 13  read(3, "", 1024)                       = 0  close(3)                                = 0  munmap(0x2aaf2000, 4096)                = 0  rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[], NULL, 8) = 0  setgroups32(1, [1000])                  = 0  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[], NULL, 8) = 0  setgid32(1000)                          = 0  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0  rt_sigprocmask(SIG_BLOCK, ~[], NULL, 8) = 0  setuid32(1000)                          = 0  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0  execve("/app-temp/busybox", ["/app-temp/busybox", "sh"], 0x7eab9d3c /* 17 vars */) = -1 EACCES (Permission denied)  fcntl64(1, F_GETFL)                     = 0x20002 (flags O_RDWR|O_LARGEFILE)  writev(2, [{iov_base="chroot: ", iov_len=8}, {iov_base=NULL, iov_len=0}], 2chroot: ) = 8  writev(2, [{iov_base="failed to run command \342\200\230/app-te"..., iov_len=45}, {iov_base=NULL, iov_len=0}], 2failed to run command '/app-temp/busybox') = 45  writev(2, [{iov_base=": Permission denied", iov_len=19}, {iov_base=NULL, iov_len=0}], 2: Permission denied) = 19  writev(2, [{iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 2  ) = 1  close(1)                                = 0  close(2)                                = 0  exit_group(126)                         = ?  +++ exited with 126 +++  

[chroot]/etc/passwd:

user::1000:1000:user:/root:/system-bin/sh  

[chroot]/etc/group:

user:x:1000:  

Permissions:

kobo:/kobo/mnt/onboard/onboard/.apps/Sanki# ls -ld app-temp  drwxrwxrwt    2 user     user            80 Jun 11 19:26 app-temp  kobo:/kobo/mnt/onboard/onboard/.apps/Sanki# ls -l app-temp/  total 2660  -rwxr-xr-x    1 user     user       1509048 Jun 11 18:52 busybox  kobo:/kobo/mnt/onboard/onboard/.apps/Sanki#  

It also gives me the same 'Permission denied' error if I try to do su user -s /system-bin/sh in the chroot as root.

Any idea of what's wrong? Thanks!

How to configure proxychains the right way?

Posted: 12 Jun 2022 02:01 PM PDT

I configured proxychains following a couple tutorials on the web which were pretty much all the same, as they showed the configuration using Tor service. The problem I'm having is that my DNS is being leaked as well as my real IP address. When I start Firefox with proxychains Google sometimes shows I'm on the other side of the globe but still shows my real IP address when prompted for captcha and other times it shows the city I live in. I did a DNS leak test as well which didn't show my location or network provider at all, but on WhatIsMyIpAddress it showed all of my info. I use Firefox with no additional proxy settings in the browser. I tried using free proxies, but every single one of them, regardless if HTTP, SOCKS4-5 gets timed out. I don't really want to use free proxies, I'd rather use the Tor service but I can't get it to work properly. The distro I use is Mint 20.3 (Una).

The proxychains.conf file:

# proxychains.conf  VER 3.1  #  #        HTTP, SOCKS4, SOCKS5 tunneling proxifier with DNS.  #           # The option below identifies how the ProxyList is treated.  # only one option should be uncommented at time,  # otherwise the last appearing option will be accepted  #  dynamic_chain  #  # Dynamic - Each connection will be done via chained proxies  # all proxies chained in the order as they appear in the list  # at least one proxy must be online to play in chain  # (dead proxies are skipped)  # otherwise EINTR is returned to the app  #  #strict_chain  #  # Strict - Each connection will be done via chained proxies  # all proxies chained in the order as they appear in the list  # all proxies must be online to play in chain  # otherwise EINTR is returned to the app  #  #random_chain  #  # Random - Each connection will be done via random proxy  # (or proxy chain, see  chain_len) from the list.  # this option is good to test your IDS :)    # Make sense only if random_chain  #chain_len = 2    # Quiet mode (no output from library)  #quiet_mode    Proxy DNS requests - no leak for DNS data  proxy_dns    # Some timeouts in milliseconds  tcp_read_time_out 15000  tcp_connect_time_out 8000    # ProxyList format  #       type  host  port [user pass]  #       (values separated by 'tab' or 'blank')  #  #  #        Examples:  #  #               socks5  192.168.67.78   1080    lamer   secret  #               http    192.168.89.3    8080    justu   hidden  #               socks4  192.168.1.49    1080  #               http    192.168.39.93   8080      #  #  #       proxy types: http, socks4, socks5  #        ( auth types supported: "basic"-http  "user/pass"-socks )  #  #  [ProxyList]  # add proxy here ...  # meanwile  # defaults set to "tor"  socks4  127.0.0.1 9050  socks5 127.0.0.1 9050  

Ethernet port won't detect cable if it was plugged before boot

Posted: 12 Jun 2022 10:13 AM PDT

I'm having trouble connecting a computer to the internet. I am able to do it only if I follow the steps below (which is not a desired behavior), and I need help to make it work properly.


THE PROBLEM

It is happening on a computer that its intended to be used like an amateur's server.

The physical port will only detect the cable if I follow these steps:

  • disconnect the eth cable.
  • reboot the computer.
  • wait the os to load.
  • plug the cable.

If I don't follow these steps, the computer won't recognize the cable, and it will not be able to reconnect to internet. The LED's on the physical port won't turn on, and the result of sudo ethtool eth0 | grep Link will be Link detected: no

This problem is specially bothering since it's supposed to be a 'server'.


MY THOUGHTS AND QUESTIONS

I'm thinking it might be a driver problem (and I just hope this is not a hardware issue). I don't really know what to do next.

How can I debug this kind of problems any further?

Is there a tool to look for updated drivers (a console tool would be preferable)?

Is there a work-arround I can use for the time being (like a cron resetting the interface if no ping to 8.8.8.8)?


SYSTEM INFO

The motherboard is an Asus Z590-A PRO

The eth interface is an Intel® 2.5G Ethernet The controller is Intel Ethernet Controller I225-V (rev 03)

The OS is HiveOs 0.6-217@220510, based on Ubuntu 18.04


ADDITIONAL INFO

I don't know when this problem started, since I bought the ethernet cable today. Before that I was working with an USB WIFI antenna, which wasn't great either.

I have not any other OS installed, nor a live USB to do testing. I'll have to wait to Monday for doing so.

The Eth cable is not the problem, I tested it on a router and my laptop, It worked on both.

Not sure if relevant, but I'm using netplan, which was't installed by default. this is my /etc/netplan/config.yml file

network:    version: 2    ethernets:      eth0:        dhcp4: no        dhcp6: no        addresses: [192.168.x.y/24]        gateway4: 192.168.x.1        nameservers:          addresses: [8.8.8.8,8.8.4.4]  

(x and y are numbers)

I tagged "Ubuntu" since the OS is based on it and there is no tag for "hive"


UPDATE

I brought the computer to the office I work on, and there I don't have the problem.

I think it might have been the router.

I'll bring the computer back to the house next month or the month after that. Meanwhile I'll just leave it there.

I'll leave this question open so if the problem comes back when I bring the computer here, I can debug it properly, find the root cause, and leave here useful information for anyone who has this problem on the future.

Thank you all who have helped me here.

How do I prevent Virt-Viewer from capturing keyboard shortcuts?

Posted: 12 Jun 2022 01:06 PM PDT

I am using Debian 11, virt-manager and LXD to do virtualization.

I need a way to prevent virt-viewer from capturing things like Super key, Ctrl+PrintScreen, the number pad, etc.  I use a lot of keyboard shortcuts that are designed for my workflow outside the virtual environment; everything from adjusting volume to quickly taking notes to managing my time tracking system is done with keyboard shortcuts.

VirtualBox and spicy both have options for this. And since virt-viewer is supposed to be a more up to date version of spicy, it's frustrating to see this feature missing or buried someplace unintuitive.

In spicy the option is shown here: enter image description here

I would use spicy and not virt-viewer, but spicy won't open multiple windows (and since it's no longer supported, I can't make a feature request).

I just need to replicate that checkbox option in virt-viewer.

Related to issue #72

Counting number of file matches from grep

Posted: 12 Jun 2022 12:58 PM PDT

How can a store the number of files matched by grep in a variable named nf?

Am using the following grep command, with the count being done by wc.

grep -rl "${isufx[@]}" -e "$ptrn" -- "${fdir[@]}" | wc -l  

zenmap not opening

Posted: 12 Jun 2022 03:07 PM PDT

I am running kali linux as a virtual machine in virtualbox, but when I click zenmap it does not open and nothing shows up, I have tried reinstalling it but the problem remains same.

when I run zenmap in terminal it shows: /usr/bin/env: 'python': No such file or directory

dig: parse of /etc/resolv.conf failed

Posted: 12 Jun 2022 12:51 PM PDT

I tried using dig and I got the error in the title.

My /etc/resolv.conf is this

nameserver 67.207.67.2  nameserver 67.207.67.3    nameserver ns1.name.com  nameserver ns2.name.com  nameserver ns3.name.com  nameserver ns4.name.com  

The first two are the default digital ocean dns, the other are for my domain registrar.

So I tried to add two cloudflare dns, and the file is this:

nameserver 1.1.1.1  nameserver 1.0.0.1    nameserver 67.207.67.2  nameserver 67.207.67.3    nameserver ns1.name.com  nameserver ns2.name.com  nameserver ns3.name.com  nameserver ns4.name.com  

After I did, dig still didn't work.

But if I comment the *name.com nameservers, dig works:

nameserver 1.1.1.1  nameserver 1.0.0.1    nameserver 67.207.67.2  nameserver 67.207.67.3    #nameserver ns1.name.com  #nameserver ns2.name.com  #nameserver ns3.name.com  #nameserver ns4.name.com  

The fact is that if I comment these *name.com nameservers, my site goes down after some minutes.

So how can I leave these *name.com nameservers and be able to use dig and nslookup and stuff like that?

Auth.log entries: How do you interpret this log?

Posted: 12 Jun 2022 05:04 PM PDT

There has been some odd behavior on my server. I pulled up the auth.log and found this (this is not my IP):

Sep 16 16:38:23 xxxxxx sshd[750]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=194.59.249.21  user=root  Sep 16 16:38:25 xxxxxx sshd[750]: Failed password for root from 194.59.249.21 port 49252 ssh2  Sep 16 16:38:29 xxxxxx sshd[750]: Accepted password for root from 194.59.249.21 port 49252 ssh2  Sep 16 16:38:29 xxxxxx sshd[750]: pam_unix(sshd:session): session opened for user root by (uid=0)  .....  Sep 16 18:49:49 xxxxxx sshd[750]: pam_unix(sshd:session): session closed for user root  

I'm reading this as:

  1. Someone tried to login at 16:38:25 and failed password.
  2. 4 seconds later they type in the correct password and gets in to the server (first attempt must therefor be a typo).
  3. 2 hours and 10 minutes later they log out.

Is my interpretation correct? If so, is there another log that shows me what they did?

Whether wildcard symbol can be added to "PATH" variable?

Posted: 12 Jun 2022 02:49 PM PDT

Scenario:

A parent folder contains many sub-folders (say a few hundred) containing executables or source programs. Say, parent folder, /opt/app1/bin/ contains many sub-folders, mod1, mod2, ..., modn. Adding all of them to the PATH variable could exceed the character per line limit or could be very clumsy!

It is understood from user dogbane's answer to what is wild card to select all directories in a directory that:

  1. the wildcard */ can be used to match directories, and
  2. the wildcard **/*/ can be used to match directories and sub-directories.

If I add the entry /opt/app1/bin/**/*/ to the PATH variable, will search executables be searched for in the sub-folders? Will there be any complications in doing so?

Is there a free (libre) open source alternative to memtest86+ that works with UEFI?

Posted: 12 Jun 2022 01:30 PM PDT

In light of memtest86+ not working with UEFI, is there an open source alternative or something I can use from grub to test memory?

Need to find a response time which takes from 1-3 seconds in Apache logs

Posted: 12 Jun 2022 11:01 AM PDT

I need to find the API response time from an Apache log file. It's like a response time which is takes between 1 to 2 secound or 2 to 3 second. $6 is response time and values comes in microseconds.

I am trying with following command but the output is always the same:

grep 17/Sep/2016:10 /access.log| awk '{print ($6 > 1000000 && 2000000 > $6)}' | wc -l  

How to change desktop background via terminal on openSUSE?

Posted: 12 Jun 2022 12:06 PM PDT

I am using SUSE Studio to make a custom version of openSUSE with the KDE 4 desktop. A small problem is that the background is set by default to the chameleon light bulb. I suspect I can fix this manually by adding a line to the script that runs at the end of a build. So, what is this command, if it exists?

Locating the directory for systemd scripts

Posted: 12 Jun 2022 02:06 PM PDT

Tried to add a startup script for CentOS, but can't find upstart script directory (which typically is in /etc/init on my ubuntu system). I heard it's in /usr/lib/systemd but it's not on my system:

[root@ lib]# more /etc/issue  CentOS release 5.4 (Final)  Kernel \r on an \m    [root@ lib]# ls /usr/lib/systemd  ls: /usr/lib/systemd: No such file or directory  

Any ideas?

expect: does "" (spawn_id exp70) match glob pattern

Posted: 12 Jun 2022 01:02 PM PDT

I have written an expect script that works perfect for testing passwords on our network until it has looped through my list quite a bit, then the debug output shows that there is nothing to match.

Here is some debug that shows the buffer with data in it, then the next spawn with no data:

ssh: connect to host 12.23.34.56 port 22: No route to host    expect: does "ssh: connect to host 12.23.34.56 port 22: No route to host\r\r\n" (spawn_id exp69) match glob pattern "(yes/no)? "? no  "assword: "? no  "]# "? no  "oute to host"? yes  expect: set expect_out(0,string) "oute to host"  expect: set expect_out(spawn_id) "exp69"  expect: set expect_out(buffer) "ssh: connect to host 12.23.34.56 port 22: No route to host"  spawn ssh -o PreferredAuthentications=password -o NumberOfPasswordPrompts=3 admin@x.x.x.x  parent: waiting for sync byte  parent: telling child to go ahead  parent: now unsynchronized from child  spawn: returns {26418}    expect: does "" (spawn_id exp70) match glob pattern "(yes/no)? "? no  "assword: "? no  "]# "? no  "oute to host"? no  "onnection refused"? no  "isconnected from"? no  expect: timed out  

Every spawn_id after exp69 has nothing in the does "" match section.

I think this is related to the buffer some how, but I've tried:

match_max 200000  match_max 600000  

And this didn't seem to make any difference. I've removed the real ips and changed it to x.x.x.x. I"m not actually testing x.x.x.x (but the 12.23.34.56 did slip into my list of servers to check)

The script itself is running expect and loops over another file called "servers.txt" and tries line by line to execute a series of commands on that server. It logs what worked and what didn't. Here is what is in the script:

#!/usr/bin/expect    # where to log info, open "writable", this is our homegrown log  # unlike the others that follow  set logfile [open "passcheck-results" "w"]    # clobber and log  log_file -noappend passcheck-logfile    # disable user viewing of process as it happens  # 1=on, 0=off  # disables screen output only, recommended 0  log_user 1    # enable verbose debugging, from expect  # 1=on, 0=off  # useful for debugging the script itself, recommended: 0  exp_internal -f debug.log 0    # default waits for 10s, and if no response, kills process  # too low and machines may not respond fast enough  # in particular real timeouts are not registered if too low  # set to -1 for infinite, real timeouts can take 60s or more  # instead of waiting 60s for EVERY failure, set this lower  # recommend the 10s default  set timeout 10      # if you do not get all the response, you expect, increase buffer  match_max 600000    # get by argv functions instead  # set nohistory save on CLI/bash  set passwords { password1 password2 password3 }    # open the list of servers to process  # warning, no error checking on file open  set input [open "servers.txt" "r"]    # loop over the list of servers with prompt logic  foreach ip [split [read $input] "\n"] {          # slowing it down a bit      sleep 2        # had to change =password to get results I wanted      # loop over line of servers      spawn ssh -o PreferredAuthentications=password \               -o NumberOfPasswordPrompts=[llength $passwords] admin@$ip        # verify where exactly to reset this count      set try 0        # account for other possibilities      expect {          "(yes/no)? " {              # new host detected              sleep 1              send "yes\r"              exp_continue          }          "assword: " {              if { $try >= [llength $passwords] } {                  puts $logfile "Bad_Passwords $ip"                  #send_error ">>> wrong passwords\n"                  exit 1              }              sleep 1              send [lindex $passwords $try]\r              incr try              exp_continue          }          "\]\# " {              puts $logfile "succeeded_$try $ip"              sleep 1              send "exit\r"          }          "oute to host" {              puts $logfile "No_Route_to_Host $ip"          }          "onnection refused" {              puts $logfile "Refused $ip"          }          "isconnected from" {              puts $logfile "Disconnected $ip"          }          timeout {              puts $logfile "timed_out_or_fail $ip"          }      }  }  

What are character special and block special files in a unix system? [duplicate]

Posted: 12 Jun 2022 11:15 AM PDT

How are character special files and block special files different from regular files in a Unix-like system? Why are they called "character special" and "block special" respectively?

Debian PowerBook G4 WiFi Driver

Posted: 12 Jun 2022 10:15 AM PDT

How do I get wifi to work on my powerbook g4 with xfce debian? I have tried sudo apt-get install bcm43xx-fwcutter but it comes up with E: Unable to locate package bcm43xx-fwcutter. What do I do?

No comments:

Post a Comment