Latest Server related questions

Score: 0
Leon avatar
Should I do the stateful matching with iptables for nat table?
gd flag

I often see that there are some stateful matching rules in a iptables' chain such as INPUT.

I known what they are doing, and I'm interested in that

Should I do the same for the chains of the table NAT?

For example, in my home router, I want it accepts ssh, and also acts as a NAT router.

If we have:

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tc ...

Score: 1
How to do sudo grep in a bash script?
in flag

I would like to check if the given ip address is already in the config file. But /etc/ can only be accessed by root, and I'm running the a script as admin. It seems I can't just do sudo

#!/bin/bash
CLIENT_WG_IPV4="10.66.66.1"

DOT_EXISTS=$(sudo grep -c "$CLIENT_WG_IPV4/22" "/etc/wireguard/wg0.conf")
if [[ ${DOT_EXISTS} == '0' ]]; then
   ...
fi

I get the error message:

grep: /etc/wireguard/wg0.conf: P ...

Score: 0
how to use terraform with nsd?
pl flag

is it possible to manage nsd dns with terraform? i keep getting a NOTINT error but per man page there is an option to accept UPDATE opcodes. when i set drop-updates: no nsd starts fine but i get the same error.

given option is in the man page it seems like it should be supported but doesnt seem to be.

https://man.openbsd.org/nsd.conf

is there some other setting i need for the terraform dns provider to wo ...

Score: 0
Litespeed - NextJS app in DigitalOcean Droplet - Restart Custom Server
cn flag

Am using the DigitalOcean OpenLiteSpeed NodeJS image from marketplace for setting up the Droplet, for running my NextJS app.

I have setup everything and when tested, the home page was displaying properly. When I clicked the Login button (that uses NextAuth v4) it was throwing an issue because of another package. So using yarn, I removed the package and re-installed it.

So after installation, I ran the

Score: 1
JDias avatar
Apache CustomLog directive failing - pipe
in flag

I have the following directive in my apache2_site.conf file:

        CustomLog "|/home/me/myjlog.py %h \"%r\"" common

which should create a log in my MySQL server. myjlog.py starts with:

#!/usr/bin/python3
import pymysql
import sys

ip=sys.argv[1]
req=sys.argv[2]
...

However, for each request to my site, the logging in my database isn't done.

What appears in /var/log/apache2/error.log is:

AH00106: pip ...
Score: 0
What kind of services does ESXI SLP port advertise to locally connected hosts?
us flag

I got enthusiastic about the last exploitations of ESXI CVE-2021-21974 (heap overflow exploitation). After researching the SLP service, which is the weak point in this CVE, I tried to turn it off, after which everything still was working perfectly fine, so I had a logical question, what kind of services SLP port on ESXI advertises about?

In addition, I would like to ask how is it possible to send ...

Score: 1
Alexis avatar
Why does everybody use MASQUERADE/SNAT instead of NAPT/PAT?
in flag

Story

I have a VPN wireguard virtual interface wg0 (can be anything else) and a physical interface eth0. I want to route packets from the VPN to my LAN, or from an interface to another interface.

Almost all the blogs, articles, tutorials advice using MASQUERADE or Source NAT only: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Moreover, IP masquerade is simply a SNAT (Source NAT), it doesn't chan ...

Score: 4
Read LTO Tape ID Tag
cn flag

LTO 6 Tapes contain a ID tag within the casing (I assume its RFID). Is it possible to read the tag via mt commands?

I would like to identify the tape that is currently loaded in the tape drive. I'm not using a tape loader. Thus the barcode scanner is not relevant here.

Score: 3
Nina G avatar
Ansible - How many can be controlled and operation in segmented networks
cn flag

I'm using the free version of Ansible at the moment. What is the maximum hosts a single Ansible controller can manage? I would assume it depends on the resources provisioned on the server but can't seem to find the docs for the free ver.

Also, in a segmented network like the example below (with a mix of Windows and Linux machines), I wasn't too sure but I assume that I need a controller for each  ...

Score: 2
Darko avatar
nginx different routes for / and /*
us flag

I'd like to route / to a.sock and /(.*) to b.sock.

I tried

    location / {
        proxy_pass http://unix:/tmp/a.sock;
        proxy_read_timeout 30;
        proxy_connect_timeout 30;
        proxy_redirect off;
        proxy_set_header Host               $host;
        proxy_set_header X-Real-IP          $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
         ...
Score: 1
pam_unix(sshd:auth): authentication failure because of encrypted password from PAM stack
bv flag

To configure sssd to connect AD server. I set id_provider to ldap

As AD server cannot accept TLS, so I closed it by:

  1. ldap_id_use_start_tls = false
  2. set ssl off in ldap.conf

When I use login ftp via domain account, it works. But it failed for ssh.

I compared the TCPdump between ftp and ssh. I found the password are different in bindrequest between ftp and ssh. It seems ssh encrypted the password, so that  ...

Score: 1
Prateek Verma avatar
Is UID required when providing a GID in an fstab entry for an ntfs drive?
us flag

I have an Ubuntu Server 20.04 installed on a Raspberry Pi 4. I am trying to mount a hard drive that should be accessible by two different samba users (user1, uid=1001 and user2, uid=1002). I created a group that contains these two users (gid=1007) and added the following entry in fstab

LABEL=WINHDD /mnt/winhdd ntfs-3g defaults,nls=utf8,dmask=077,fmask=177,gid=1007 0 0

My smb.conf has the share listed  ...

Score: 0
How to make Ansible run batch of tasks on Cluster Node's - node by node
cn flag

I have an ansible playbook which looks roughly like the following. I need Zero Downtime Upgrade start and Zero Downtime Upgrade completed steps. will run once to put\remove cluser into upgrade mode. in addition I need all the tasks into Block will be run only on one node on same time and continue to next node once we get HTTP 200

Could you please review the yml file ? currently I get ERROR! 'uri'  ...

Score: 1
Axel avatar
Block IPv6 on Tun0
ru flag

I'm setting up a VPN tunnel for some services. I created a vpntunnel/vpntunnel user/group that is routed to the tun0 interface based on the group ID. That works quite fine. Commands below run as regular user:

curl -4 ifconfig.io <= returns my public IPv4 ip
curl -6 ifconfig.io <= returns my public IPv6 ip

Because my VPN provider doesn't support IPv6 yet, my IP could be exposed. So I added an ip6 ...

The Stunning Power of Questions

Much of an executive’s workday is spent asking others for information—requesting status updates from a team leader, for example, or questioning a counterpart in a tense negotiation. Yet unlike professionals such as litigators, journalists, and doctors, who are taught how to ask questions as an essential part of their training, few executives think of questioning as a skill that can be honed—or consider how their own answers to questions could make conversations more productive.

That’s a missed opportunity. Questioning is a uniquely powerful tool for unlocking value in organizations: It spurs learning and the exchange of ideas, it fuels innovation and performance improvement, it builds rapport and trust among team members. And it can mitigate business risk by uncovering unforeseen pitfalls and hazards.

For some people, questioning comes easily. Their natural inquisitiveness, emotional intelligence, and ability to read people put the ideal question on the tip of their tongue. But most of us don’t ask enough questions, nor do we pose our inquiries in an optimal way.

The good news is that by asking questions, we naturally improve our emotional intelligence, which in turn makes us better questioners—a virtuous cycle. In this article, we draw on insights from behavioral science research to explore how the way we frame questions and choose to answer our counterparts can influence the outcome of conversations. We offer guidance for choosing the best type, tone, sequence, and framing of questions and for deciding what and how much information to share to reap the most benefit from our interactions, not just for ourselves but for our organizations.