New answers tagged linux
0
votes
how to migrate docker to use a different storage driver?
Subvolumes typically don't require a ton of work (in theory based on the fedora docs for btrfs) - should be able to rm -r /var/lib/docker/subvolumes/* but for some reason - docker dark magic - this ...
1
vote
What Linux distribution is the Amazon Linux AMI based on?
The easiest place to get this answer is from the horses mouth.
"AL2023 is RPM-based and includes components sourced from multiple versions of Fedora and other distributions, such as CentOS 9 ...
1
vote
ZFS mismatched replication level
While having RAIDZ vdevs of different width is not recommended, it is a valid configuration to use. The key point is to use the same redundancy level - RAIDZ1 in this case.
In other words - the ZFS ...
0
votes
Accepted
Bash script : Print all lines between two pattern in variables with slashes
You can use a different delimiter if you escape it at its first occurrence, so the slashes will not confuse sed. However, note that using single quotes will result in bash not substituting variables, ...
1
vote
How to run a command once a ZFS scrub *completes*?
Recent ZFS versions precisely added what the OP asked: use -w to wait for scrub to finish before returning. For example:
zpool scrub tank -w ; zpool status tank | mail -s "report" me@example....
1
vote
Accepted
Apt asks me "Which services should be restarted?", but won't accept my answer
The option for none of the above probably can't be combined with or included in a range of the specific services you want to restart, as those are mutually exclusive.
Valid input to select all ...
0
votes
VLANs and Bridges on Debian to share the same address
so that the physical port looking inside my network (eth1) would accept both new VLANs, frames without VLAN-id (untagged)
That won't work. You need to configure a subinterface on your NIC with 802.1q ...
0
votes
nginx and php-fpm waiting for server too long
Yes, there's stuff wrong with your config, but your primary issue is arising within the PHP execution (or any persistence layer such as a DB underneath the PHP).
Check for session contention, ...
1
vote
Accepted
Blocking traffic from specific countries. How to kill existing connection?
Since several years, the Linux kernel has been having an API to forcibly kill existing IP sockets whatever their state. It can be done with the ss command and its filter syntax:
-K, --kill
Attempts ...
0
votes
nginx and php-fpm waiting for server too long
You should install xhprof, this way you'll see where the time is spent.
Using PECL (https://pecl.php.net/package/xhprof)
pecl install xhprof
And use the xhprof_html and xhprof_lib from this project ...
1
vote
how to require publickey and otp, or password and otp when logging in with ssh?
The problem stems from PAM and it almost makes it impossible.
The core problem is that the publickey stuff is handled by the ssh daemon, while keyboard-interactive is always handled by PAM (and ...
1
vote
Logging Source IP of SMB Login Attempts
I have not used the TrueNAS OS personally, but it-appears to have no issue with being able to SSH in, and it supports tcpdump. SO you should be able to trap SMB traffic in a packet capture and see ...
1
vote
vsftpd and home directories of chrooted local users
A chroot simply changes the root folder of the directory tree, so you can't cd a folder up from that point. Somehow developers have assumed $home_folder should be the chroot and packaged the two ...
1
vote
Filtering for HTTP methods in IPv6 packets using tcpdump
Limitations of tcpdump with IPv6 as of versions 4.99.x
For IPv4, to get the payload offset in the packet one can just more or less compute the payload offset by using IPv4's IHL + TCP's data offset ...
1
vote
Accepted
How do CPUShares work across parent and children cgroups?
Whilst the hierarchy you laid out above appears valid https://docs.kernel.org/admin-guide/cgroup-v2.html rules out this kind of hierarchy. The documents use the phrase "No Internal Process ...
0
votes
Is it possible to set CPUAffinity=0 for a specific process in its systemd service unit file?
The default CPU affinity mask CPUAffinity=0,24,48,72 applies to all services managed by systemd, but you can set your own affinity settings per unit.
To set a CPU affinity mask for a systemd service, ...
0
votes
Linux: Run a specific command as another user?
Besides sudo, mentioned by @HBruijn, you can also use pkexec from Polkit (aka Policy Kit). See also: polkit(8) man page.
0
votes
Why does mdadm --zero-superblock preserve file system information?
I have try this too, do raid-1 for data cloning. Preserving data after --zero-superblock only can work on metadata=0.90 or 1.0, and I guess this is a bug. Because metadata=0.90 or 1.0 putting the ...
0
votes
How do I convert my linux disk from MBR to GPT with UEFI?
Sorry first of all, have not been here for some time and I can only "answer"? I want to ask a further question on the same topic. I am currently trying to convert everything to GPT/EUFI so I ...
0
votes
VPN on Linux - IP routing issue
NOTE: In this answer, the network 100.64.10.0/23 represents the public network. It's not particularly relevant but exists only to make the network configuration of these virtual nodes match what you'...
0
votes
Exim, Debian 12 (bookworm): Tainted '..Maildir/' (file or directory name for maildir_local_delivery transport) not permitted
I think you just need to replace
directory = /home/${local_part}/Maildir/
with
directory = /home/${local_part_data}/Maildir/
At least that is the first thing I found on
https://mox.sh/sysadmin/...
0
votes
Have you got a worked example of using Postgres through ODBC with openssl and the Progress DataDirect Linux driver?
I put the following in ~/odbc.ini
[ODBC Data Sources]
POSTGRES=DataDirect ODBC Postgres Wire Protocol
;# POSTGRES stanza
[ACEDB]
DRIVER=/home/tjcw/ODBC/drivers/lib/UKpsql95.so
Description=IBM ...
1
vote
Accepted
How to use nft on linux bridge to block access to certain ip addr?
This is done using nftables' bridge family.
nftables provides the bridge family as a replacement for ebtables.
Create a table in the bridge family:
# nft add table bridge t
Create a chain to filter ...
3
votes
Accepted
Samba share not accessible to client in the same network
You've got two issues here
You're trying to access \192.168.1.20\testshare instead of \\192.168.1.20\testshare. I'm going to assume that's a typo but it's important to be precise
You have a hosts ...
0
votes
How to use nft on linux bridge to block access to certain ip addr?
If your linux host is running as a router you need to configure ip_forwarding as well.
To answer your question, you could use nftables like this:
#!/usr/bin/nft
flush ruleset
table inet my_table {
...
0
votes
Can I automatically add a new host to known_hosts?
Modern versions of SSH support certificate authorities, much like the ones used for SSL/TLS which secure your everyday web browsing. This allows you to bypass the Trust On First Use mechanism, as ...
0
votes
How to make Postfix route mails through sender-specific relay instead of smarthost?
You could likely avoid the transport rule that takes precedence, by using your relay_by_sender file for everything:
# Exceptions
[email protected] [example-com.mail.protection.outlook.com]:25
...
1
vote
Linux: Run a specific command as another user?
I want to be able to allow users to run a specific command as another user, is this possible?
Yes
That is what the sudo command is designed for.
Although many novice Linux sysadmins only know and use ...
1
vote
Accepted
Show quota limit of user's home directory
With the currently given information and because of the nature of BTRFS Quota groups
... Above command works well for root user ... Can anybody explain the cause of the error?
the command needs to ...
1
vote
Creating a custom filter for fail2ban
I know this is an old question, but it still appears in search engine results, so here's a detailed answer.
For regular expressions, [ALR] and similar bracketed character strings have a special ...
3
votes
Accepted
Is it possible to configure a Linux/Ubuntu computer to be network silent?
You can make your machine completly silent with one of following solutions:
drop any outgoing packets from firewall
don't configure any IP addresses on interfaces where you want it to be silent
You ...
0
votes
Reasons for Permission denied on execution
In my case on arm64 embedded system with own initramfs the error fully fixed by 2 simple commands:
# chmod a+x /lib/ld-2.31.so
# export LD_LIBRARY_PATH="/lib"
How I've found this fix? ...
0
votes
Accepted
SSL Certificate Renewal Broke Payment Gateway - Modulus Mismatch
Lots of words here, what you seem to be saying is:
HTTPS site was working
certificate renewed
new certificate does not match existing key hence HTTPS no longer working
This should not happen. If you ...
0
votes
Unable to Connect To Repo Server On Local Network
After checking the error logs, I could see Permission Denied message. The issue was that I didn't have the correct file context on my test_repos directory. It should have been httpd_sys_content_t ...
1
vote
Accepted
AD Domain joined linux server equivalent of NLA
That's a lot to address, but essentially what is needed is a "kerberized" SSH or whatever. NLA also provides an additional step (not specified here) of not providing a console session (which ...
2
votes
Accepted
Different behavior of `man` for root and user
I've tested it and you are right. The thing you overseen is that man /usr/bin/find display page, not binary. More than that if you add /bin to $PATH it will display page instead of binary for man /bin/...
0
votes
Is there a Unix / Linux command to count lines per second from stdin?
Unfortunately, some of the tools given in these answers are not installed by default in most of the Linux distos.
Here is a piece of command line that should work everytime (Perl is almost everywhere)
...
1
vote
KVM: qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory
This is not KVM/QEMU/LIBVIRT bug, since it is the kernel running out of system memory by allocating of 1G.
This can be:
impossibility to free cached blocks by the FS (depending on type of FS, e. g. ...
1
vote
Accepted
Best Practices for Setting Up Multiple OpenVPN Instances for Different Clients
OpenVPN manual states that it will trust any certificate that is descendant of the CA certificate you configured in it. So, to really separate VPNs you omit root certificate from all configurations. ...
0
votes
Fork connections out from a single socat connection
I don't understand the problem you're trying to solve: is logserver unable to handle multiple-request connections (and the application still uses them contrary to HTTP standard)? Below I'll assume ...
0
votes
How to grep httpd error_log within a time range?
If anybody wants to get the logs within the particular time rage, maybe you want to get the logs within 5 min you can do like the below
For dynamic time range (eg you dont know the time range but ...
0
votes
Errors to do with modules when using net-snmp utils
As anotha office gangsta eluded to, this issue might be due to a bug in 5.7 release.. nevathaless.. the issue you're encountering with the Net-SNMP utilities can be caused by several factors. Let's ...
0
votes
wordpress directory file ownership changes everytime after uploading files/plugins
Your description of how this is provisioned is not helpful. Lets start from scratch.
Users:
apache - the uid your PHP runtime executes as
dev1, dev2, dev2 - developers
backup - for creating backups ...
0
votes
VS Code Remote Development giving back error
I experienced a similar error and managed to get it working again by installing a previous version of Visual Studio Code. All of my extensions and settings remained in place.
Also, you'll need to ...
1
vote
Tomcat Service failed
Your error message says "permission denied" on catalina.sh. Please verify that the file is executable and also owned by the tomcat user that you specified in the service file.
0
votes
Is there a smarter tar or cpio out there for efficiently retrieving a file stored in the archive?
There's also pixz. It compresses an uncompressed tar archive with xz and adds an index at the end. For any program that doesn't know about pixz the resulting file is just a .tar.xz file so many ...
0
votes
wordpress directory file ownership changes everytime after uploading files/plugins
The web server (or the PHP process, depending on your setup) needs write access to the directory. The only feasable way is to run said process as the user websitename.
Principally another option would ...
0
votes
Prometheus Alerting on NodeClockNotSynchronising for VMs
For ntpd: run the ntpddeamon without the option -x
Edit the ntpd configuration file and remove the -x option
vi /etc/sysconfig/ntpd
Restart the ntpd.service
systemctl restart ntpd.service
For chronyd: ...
0
votes
How to list all nearest scheduled jobs in bacula bconsole
Simply use the command status director. Here you can see that JOBA, JOBB, JOBC, JOBD and BackupCatalog are coming.
*st dir
localhost-dir Version: 9.0.6 (20 November 2017) x86_64-redhat-linux-gnu ...
1
vote
Accepted
ssh proxyjump command to config file
See man 5 ssh_config:
ForwardAgent yes
IdentityFile .ssh/id_file
Host jump_node
User user1
Host remote_node
ProxyJump jump_node
User user2
and just run ssh remote_node.
You can even build ...
Top 50 recent answers are included
Related Tags
linux × 38302ubuntu × 3551
centos × 2985
networking × 2667
debian × 1952
ssh × 1870
iptables × 1704
apache-2.2 × 1667
bash × 1317
redhat × 1244
security × 1162
linux-networking × 1016
mysql × 1003
php × 933
windows × 887
filesystems × 844
nginx × 843
unix × 767
domain-name-system × 762
permissions × 679
email × 669
routing × 659
raid × 646
firewall × 645
postfix × 601