date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,568,020,347,000
My Fedora 26 (was 25 when installed/joined to AD) has a long timeout when I run sudo for my Active Directory user if I leave it alone for to long. Timeout is long. 25 seconds. I used strace (sudo strace -tt -o sudo_wait.strace sudo dnf update -y) to see if I could see what the system was doing for those 25 seconds, bu...
Is your AD user a member of many large AD groups? This is typically the case, usually suppressing the group members with the ignore_group_members option helps. Alternatively, checking the sssd logs if the machine is able to connect to AD DCs and is not e.g. timing out the connection is also a good thing to do.
Sudo long wait for Active Directory user
1,568,020,347,000
I have an administration node running LDAP and a login node which uses LDAP on the other node to authorize users. Users are able to log into the login node successfully. When I run getent passwd, on the admin node I get all the users, both those from /etc/passwd and LDAP. However, on the login node the LDAP users ar...
The suggestion to delete the sssd cache was indeed correct. However, running sss_cache -E did not help. I had to actually delete the relevant files with rm -rf /var/lib/sss/db/*
'getent passwd' not showing LDAP users, athough users can log in
1,568,020,347,000
I was able to successfully join my Ubuntu 18.04 machine into AD. For this I'm using SSSD and Kerberos. I can ssh into in using AD domain credentials. Everything is fine except that those domain users are not persistent. When a domain user enters a Windows machine, then a home directory is created automatically and the...
To enable creation of users home directories exec this command (as root): pam-auth-update --enable mkhomedir About not available AD - sssd support cache so for some time you will be able to login with cached credentials. In domain section of sssd.conf you can add something like to manage the time: cache_credentials =...
Linux in Active Directory: Persistent users
1,568,020,347,000
There are two RHEL 8 servers which have been provisioned from the same template, with some manual fix and tweaking done manually on the first server only. They allow SSH user authentication via a remote LDAP server, and have been configured with authselect: authselect select sssd --force The first server works perfec...
Found the problem. The sssd configuration contains the line ldap_access_filter = (host=<hostname>.mydomain.org) where hostname is the local host name for each server. However, the second server wasn't referenced in the LDAP server, only the first one was. Adding an entry for the second server on the LDAP solved the ...
Authentication via LDAP: where is ldap_search_ext defined?
1,568,020,347,000
Generally, it seems, the idea with conf.d-style directories is to allow a very modular, drop-in method to add features or configurations. With SSSD, specifically, it would seem logical to add further domains to configuration files under /etc/sssd/conf.d/ (RHEL). The domains directive in the [sssd] section of the conf...
You're right that defining domains is not well defined. What we plan on doing for (one of) the next version(s) is to make the domains= parameter optional. That way, any defined domain section would automatically be enabled and you could just drop domains and control their order by names of the snippets that include th...
SSSD Domain Configuration Snippets
1,568,020,347,000
nslcd.conf has "map passwd uid" to map attributes that will be used as the Login username. What is the sssd.conf equivalent of that?
Figured it out: ldap_user_name
"map passwd uid" equivalent in sssd
1,568,020,347,000
I'm encountering an issue with the keytab entries that are automatically created when I join a Linux server to an Active Directory domain. First, my process: Install the needed Linux packages yum install realmd pam sssd adcli oddjob oddjob-mkhomedir samba-common-tools krb5-workstation Create Computer object in Active...
I'd say that you shouldn't be adding these SPNs to the host's keytab (computer account) in the first place. Services such as Samba (cifs) or SSH (host) can continue to use it, but everything else (HTTP, imap, etc.) should have their own independent keys in their own keytab files. (Broadly, if the service isn't in AD's...
krb5.keytab entries need to have uppercase service type
1,568,020,347,000
I am working on getting SSH to accept AD credentials. Server details CentOS 8 Server is successfully joined to the domain Ran realm discover which returned proper information regarding our AD environment realm permit run to permit specific users SSH config file has been slightly modified. It mainly only blocks root l...
I was able to finally figure this issue out. There was one main issue: My SSSD config was missing values to define the users shell I was initially alerted to this issue by the following post: Highlight of error in SSH debug Specifically, there was the following line the SSH debug that was indicating the problem clie...
SSH disconnecting after successful auth when using AD credentials
1,568,020,347,000
sssd has the following config to set the interval for the sudo rules refresh: ldap_sudo_full_refresh_interval What is the configuration to set the interval for the netgroup definition retrieval from LDAP?
use the following configuration item in the sssd.conf to control this: entry_cache_timeout = {time in seconds} e.g. entry_cache_timeout = 30
ldap netgroup refresh interval in SSSD
1,440,770,754,000
I currently manage an IDM (FreeIPA) cluster and have full sudo rights, i.e. I can become root via sudo -Es. I'd like to verify a sudo rule that I've added to FreeIPA on a specific server to confirm that the rule is being picked up properly by the host via SSSD. How can I do this? NOTE: the sudo rule is as follows: $ ...
The easiest method I've found to accomplish this is to SSH to a server which will be picking up the sudo rule and check a user in the group that's being granted this type of access. You can use the sudo commands -l and -U switches: $ man sudo -l, --list If no command is specified, list the allowed (and ...
How can I confirm another user's sudo permissions using my sudo permissions?
1,440,770,754,000
After migration form debian jessie to stretch - login over ssh fails for Ad users, also su to AD user (sssd env) fails. Any hints? Log lines: Jun 20 12:48:57 myhost sshd[1736]: pam_sss(sshd:account): Access denied for user testuser: 4 (System error) Jun 20 12:48:57 myhost sshd[1736]: fatal: Access denied for user test...
The configuration file /etc/sssd/sssd.conf needs the following entry. [domain/your.domain] ad_gpo_access_control = permissive I found the solution at the Ubuntu sssd bug page
sssd / ad no ssh login after migration debian 8 => 9: Access denied for user xxx: 4 (System error)
1,440,770,754,000
I use an Active Directory server for authentication,Solaris works fine following this Howto. All works,and my user "user1" get the right UID assigned on Windows AD,which is 10000. On linux I follow this howto and I can join the AD..user works but..id is totally different,not 10000 but "uid=744201108",how to get the co...
The SSSD docs cover this in some detail. Essentially, by default when SSSD is used to join a new domain, it assigns a block of UID's designed to be unique to that domain, that override any that AD might have assigned. This allows multiple domains to be used, and ensure that users from all domains get unique UID's. Thi...
On Solaris I get good id mapping..on linux not,why?
1,440,770,754,000
I have a similar question running on serverfault, but i have a followup question that is more suited here, in my humble(likely uninformed) opinion. I have been trying to validate users in my Debian Wheezy server against the company AD(windows 2008 server). The main challenge is that this AD does not supply any Unix at...
Version 1.11.7-2 from testing works for me in a production environment. You don't need to upgrade your entire system from stable, just add a testing repository: deb http://ftp.uk.debian.org/debian/ testing main contrib non-free deb http://ftp.uk.debian.org/debian/ testing-updates main contrib non-free You may need to...
sssd-ad in wheezy
1,440,770,754,000
as I mentioned in another thread, I have an LDAP system supporting two dozen Linux servers. When LDAP server is down for various reasons (firewall rule changes, power outage etc), my rest of the systems became hanged. I am hoping to build some redundancy, and stumbled upon articles on using nscd or sssd for caching lo...
If I understood correctly, nscd caches password for 10 min for each login. No, it only caches the user information that would be found in /etc/passwd, which is generally everything except the password. That would be the shadow map – but most LDAP configurations do not use shadow; they don't reveal the password hash ...
Understanding risks of setting nscd positive-time-to-live to a longer duration
1,440,770,754,000
I have a vendor application installed in an Ubuntu Jammy server that relies on SSSD v2.6.3 configured for LDAP integration for the authentication and creation of the home directory of the user in the server. In the sssd.conf configuration it is present: [sssd] config_file_version=2 reconnection_retries=3 services=nss,...
In this case the problem actually resided in the vendor application doing the authentication that did not trigger the PAM modules for the session, a modification on this vendor application's configuration allowed the authentication process to invoke the PAM session configuration we have set for creating the home direc...
Why SSSD Service override_homedir triggers creation of home directory with wrong permissions?
1,440,770,754,000
By now, we are using OpenSSH GSSAPI authentication on all of our servers (Debian from 10 to 12). Then we sudo -i, using ldap authentication (through sssd-ldap). I would like to get rid of the ldap authentication and rely on GSSAPI only, both for OpenSSH and Sudo. The idea is to to forward Ticket service to Openssh (ho...
Is there a way to keep the ticket service forwarded to openssh inside a credential cache? It would help me to authenticate sudo afterward. No, there's no option to do that. (It would be possible in theory, but it's not an implemented function.) However, it might be possible to use PAM to acquire a "S4U2self" ticket,...
How to authenticate through OpenSSH then sudo with only one Ticket Service (Kerberos TGS host/fqdn)
1,440,770,754,000
I have a RHEL 7.6 server joined to AD using sssd and realm. I am able to SSH into the Linux servers as AD users, but the same users are unable to access the Samba share configured in the server. When I try to access the share from Windows Server 2012 R2 Standard, it keeps prompting me for the password. This is how I c...
Stop using sssd. From Samba >= 4.8.0, Shares and sssd are incompatible. If you want shares, then you must use winbind.
AD users unable to access Samba Share
1,440,770,754,000
I have a very small vm installed, for testing purposes, running CentOS 1708, with vsftp configured. i used https://www.rootusers.com/how-to-join-centos-linux-to-an-active-directory-domain/ to setup ad authentication for the OS part, but did not want ad users to be able to login via FTP client. Primarily i need the ad...
The PAM modules involved in vsFTPd authentication are defined in /etc/pam.d/vsftpd. By default, it has a line: auth include password-auth which uses the system-wide default PAM configuration for password-based authentication that is specified in /etc/pam.d/password-auth. When AD authentication is configured, the...
Prevent vsFTP auth via AD
1,440,770,754,000
I just got a user account on a server with its nsswitch pointing at ldap. Something is wrong with my home folder (I don't have one). Generally the home folders are mounted by automount/autofs and the automount maps are in ldap. In the bad old days of NIS it would have been as easy as ypcat auto.home | grep myusername ...
The following seem to describe configured automount maps in a way that alleviates the need to learn ldap. You might need to be root for it to work. automount --dumpmaps
Linux getent automount?
1,440,770,754,000
I have setup Redhat host to authenticate AD users for ssh sessions. Everything is working as expected, however, single concern, user credentials are being cached somewhere. Upon first time login using ssh, user is asked to enter the password however, later on (second third attempts etc), whenever user initiates the ss...
I figured out the issue, SSH Sessions Credentials were being cached in my terminal. MobaX freeware was being used with "save password" defaults to yes. Cleared the password vault. ¯\_(ツ)_/¯ ¯\_(ツ)_/¯
sssd caching user credentials even the cache_credentials is set to false
1,440,770,754,000
Today I use the same keytab for all Linux servers (hundreds). I'm considering using a different keytab for each machine because I suppose that if I use the same keytab the Active Directory thinks I have only one machine but apart from this I don't see many benefits of using different keytabs. Why should I use a differ...
Using different keytabs for each machine allows you to selectively remove systems from your domain. If a single one of your systems was compromised, and you used the same keytab for all of your systems, and you want to boot the rogue system from your domain, you'll be forced to revoke the keytab from the AD server fo...
What problems could I have if I use the same keytab for all Linux servers authenticating against Active Directory?
1,440,770,754,000
I am struggling with making sssd use LDAP users to login on my Linux-Server (Oracle Linux 8.9, basically identical to RHEL, but free). Goal Using the users (e.g. "John") existing on the LDAP-Server (Microsoft AD DC) to log in on my Linux-Server Current Errors Whenever I enter the command "id John" or "su - John" I rec...
Looking at the log files with debug_level = 6 enabled, it's evident that the LDAP query is being performed but no results are returned: [RID#6] Searching for users with base [dc=my,dc=domain,dc=com] [RID#6] calling ldap_search_ext with [(&(sAMAccountName=John)(objectclass=user)(sAMAccountName=*)(&(uidNumber=*)(!(uidN...
"no such user" - LDAP authentication with sssd
1,440,770,754,000
I've got a CentOS7 server joined to a Windows Active Directory Server. I'm trying to connect to CentOS using my Active Directory credentials but it seems that it checks the local account as first step and LDAP as second. That's because I'm receiving a message that order me to change the local account password. Is the...
Maybe, I found the solution. I'm using SSS which is using OpenLDAP not LDAP. So, is it possible to switch "sss" parameter before "files" in order to run sssd on the right way. .... passwd: sss files shadow: sss files group: sss files ....
Change authentication order GNU/Linux
1,440,770,754,000
I have configured the users through SSSD native AD support. However when I try to access the share it's mapped as "Unix User\username@domain" instead of "domain\username". My sssd: [sssd] config_file_version = 2 domains = domain.com services = nss, pam [nss] [pam] [domain/domain.com] cache_credentials = true id_pro...
I needed to point /usr/lib/libwbclient.so.* libraries to /usr/lib/sssd/modules/libwbclient.so.*. I sent a bug report for Gentoo to properly handle it.
Samba does not perform reverse mapping for sssd users
1,327,810,934,000
Since recently Debian has changed the default behavior for dmesg and I cannot use it simply from my local user. % dmesg dmesg: read kernel buffer failed: Operation not permitted Same goes for: % cat /dev/kmsg cat: /dev/kmsg: Operation not permitted Starring at the bug tracker this lead to: dme...
So it was actually trivial, looking at the very last message from the bug report: Re: Bug#842226: dmesg: read kernel buffer failed: Operation not permitted Part of the changelog from the aforementioned kernel: security,printk: Enable SECURITY_DMESG_RESTRICT, preventing non-root users reading the kernel log by de...
dmesg: read kernel buffer failed: Permission denied
1,327,810,934,000
We are installing SAP HANA in a RAID machine. As part of the installation step, it is mentioned that, To disable the usage of transparent hugepages set the kernel settings at runtime with echo never > /sys/kernel/mm/transparent_hugepage/enabled So instead of runtime, if I wanted to make this a permanent change, s...
To make options such as this permanent you'll typically add them to the file /etc/sysctl.conf. You can see a full list of the options available using this command: $ sysctl -a Example $ sudo sysctl -a | head -5 kernel.sched_child_runs_first = 0 kernel.sched_min_granularity_ns = 6000000 kernel.sched_latency_ns = 18000...
disable transparent hugepages
1,327,810,934,000
I don't understand the best way to set fs.inotify.max_user_watches with sysctl. In fact, I don't understand much of what is happening here other than the fact that I need to set the number of files that can be watched by a particular process. I believe that I can see the max number of users by running this command: c...
sysctl -w writes kernel parameter values to the corresponding keys under /proc/sys: sudo sysctl -w fs.inotify.max_user_watches=12288 writes 12288 to /proc/sys/fs/inotify/max_user_watches. (It’s not equivalent, it’s exactly that; interested readers can strace it to see for themselves.) sysctl -p loads settings from a...
How to set and understand fs.notify.max_user_watches
1,327,810,934,000
In sysctl, the /proc/sys/net/ipv[46]/conf/ keys have the following subkeys: all, default, and a key for each network interface. For example, on a machine with a single network interface eth0, it will look like this: iserv ~ # ll /proc/sys/net/ipv[46]/conf/ /proc/sys/net/ipv4/conf/: insgesamt 0 dr-xr-xr-x 0 root root 0...
I'm going to supply a new answer to this question, since many Google search results lead here, and the internet has a lot of outdated information and misinformation about this. net.ipv{4,6}.conf.default.* @Martin von Wittich's correct about the behavior of default-- it's applied to new interfaces only. For a host's in...
What is the difference between "all", "default" and "eth*" in /proc/sys/net/ipv[46]/conf/?
1,327,810,934,000
On my Ubuntu machine, in /etc/sysctl.conf file, I've got reverse path filtering options commented out by default like this: #net.ipv4.conf.default.rp_filter=1 #net.ipv4.conf.all.rp_filter=1 but in /etc/sysctl.d/10-network-security.conf they are (again, by default) not commented out: net.ipv4.conf.default.rp_filter=1 ...
Checking the value of a sysctl variable is as easy as sysctl <variable name> and, by the way, setting a sysctl variable is as straightforward as sudo sysctl -w <variable name>=<value> but changes made this way will probably hold only till the next reboot. As to which of the config locations, /etc/sysctl.conf or /etc...
Finding out the values of kernel options related to sysctl.conf and sysctl.d
1,327,810,934,000
After executing the following to disable ping replies: # sysctl net.ipv4.icmp_echo_ignore_all=1 # sysctl -p I obtain different results from pinging localhost vs. 127.0.0.1 # ping -c 3 localhost PING localhost(localhost (::1)) 56 data bytes 64 bytes from localhost (::1): icmp_seq=1 ttl=64 time=0.029 ms 64 bytes from l...
The ping command shows the address it resolved the name to. In this case it resolved to the IPv6 localhost address, ::1. On the other hand, 127.0.0.1 is an IPv4 address, so it explicitly makes ping use IPv4. The sysctl you used only affects IPv4 pings, so you get replies for ::1, but not for 127.0.0.1. The address y...
What is the difference between ping localhost and ping 127.0.0.1?
1,327,810,934,000
Between Debian 5 and 6, the default suggested value for kernel.printk in /etc/sysctl.conf was changed from kernel.printk = 4 4 1 7 to kernel.printk = 3 4 1 3. I understand that the first value corresponds to what is going to the console. What are the next 3 values for? Do the numerical values have the same meaning a...
Sysctl settings are documented in Documentation/sysctl/*.txt in the kernel source tree. On Debian, install linux-doc to have the documentation in usr/share/doc/linux-doc-*/Documentation/ (most distributions have a similar package). From Documentation/sysctl/kernel.txt: The four values in printk denote: console_loglev...
Description of kernel.printk values
1,327,810,934,000
After update to kernel 5.10.119, /proc/sys/kernel/random/entropy_avail became stuck to 256 and does not change when moving the mouse. It used to be greater than 3000. # cat /proc/sys/kernel/random/entropy_avail 256 Also, /proc/sys/kernel/random/poolsize went down to 256. It used to be 4096. Is this a bug? Can you t...
With no intention to compete with Marcus' complete answer. Just to explain what happened and justify that what you are noticing is not a bug. Default poolsize is hardcoded in drivers/char/random.c but something actually changed in 5.10.119 : Up to 5.10.118 : #define INPUT_POOL_SHIFT 12 #define INPUT_POOL_WORDS (...
kernel 5.10.119 caused the values of /proc/sys/kernel/random/entropy_avail and poolsize to be 256
1,327,810,934,000
I've read two separate ways of increasing the allowed open file count (I'm attempting to modify for root, if it matters). One way is to update the settings in /etc/security/limits.conf with something like: * soft nofile 500000 * hard nofile 500000 root ...
The difference is the scope, and how it's applied. Open file limits set via sysctls apply to the entire system, whereas limits set via /etc/security/limits.conf apply only to things that meet the criteria specified there. The other primary difference is that /etc/security/limits.conf limits are applied via ulimit, a...
What's the difference between setting open file limits in /etc/sysctl.conf vs /etc/security/limits.conf?
1,327,810,934,000
This question is associated with Where is core file with abrt-hook-cpp installed? . While I was trying to generate a core file for an intentionally-crashing program, at first core file generation seemed to be stymied by abrt-ccpp. So I tried to manually editing /proc/sys/kernel/core_pattern with vim: > sudo vim /proc/...
Entries in procfs are managed by ad hoc code. The code that would set permissions and ownership on the files under /proc/sys (proc_sys_setattr) rejects changes of permissions and ownership with EPERM. So it isn't possible to change the permissions or ownership of these files, full stop. Such changes are not implemente...
Why is editing core_pattern restricted?
1,327,810,934,000
My Linux kernel must have been configured with user_namespaces when built, but their use is restricted after boot and has to be explicitly enabled. Which sysctl should I use? (If this was turned on, this would allow to run an isolation command like unshare --user --map-root-user --mount-proc --pid --fork, and then per...
Debian-based Linux Debian (and hence probably Ubuntu, too) has been known to ship a kernel with such a restriction of user_namespaces, and there the way to enable it was/is: sysctl -w kernel.unprivileged_userns_clone=1 (Source: https://blog.mister-muffin.de/2015/10/25/unshare-without-superuser-privileges/.) Since ker...
How to enable user_namespaces in the kernel? (For unprivileged `unshare`.)
1,327,810,934,000
I want to enable reversed path filtering to prevent source ip spoofing on my server. I noticed that I have the following settings at current: net.ipv4.conf.all.rp_filter = 0 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.lo.rp_filter = 0 net.ipv4.conf.p4p1.rp_filter = 1 net.ipv4.conf.eth0.rp_filter = 1 The settin...
According to this post titled: all vs. default in /proc/sys/net/ipv4/conf [message #3139]: When you change variables in the /proc/sys/net/ipv4/conf/all directory, the variable for all interfaces and default will be changed as well. When you change variables in /proc/sys/net/ipv4/conf/default, all future interfaces wi...
What is the difference between all and default in kernel setting? [duplicate]
1,327,810,934,000
I've been wondering for last few days how exactly does it work. We can set kernel runtimes parameters using sysctl or echo boolen 1> /proc/sys/module/exactParameter but in /sys/modules/module/parameters/parameter we can also set values. Are parameters for modules in /proc/sys/ related only to hard complied into kernel...
There is little relation between /proc/sys and /sys other than the fact that both are kernel interfaces and a coincidence of names. /proc/sys is an interface to sysctl, which are kernel configuration parameters. Reading or modifying /proc/sys/foo/bar is equivalent to getting or setting the foo.bar sysctl. Sysctl value...
/proc/sys vs /sys/modules/mod/parameter
1,327,810,934,000
There's an issue with Ubuntu that hasn't been fixed yet, where the PC freezes or gets really slow whenever it is copying to an USB stick (see Why is my PC freezing while I'm copying a file to a pendrive?, http://lwn.net/Articles/572911/ and https://askubuntu.com/q/508108/234374). A workaround is to execute the followi...
These are sysctl parameters. You can set them either by writing to /proc/sys/CATEGORY/ENTRY or by calling the sysctl command with the argument CATEGORY.ENTRY=VALUE. These settings affect the running kernel, they are not persistent. If you want to make these settings persistent, you need to set them at boot time. On Ub...
Pernicious USB-stick stall problem. Reverting workaround fix?
1,327,810,934,000
I always have /proc/sys/kernel/panic set up to 0. Looking at description of this option in kernel.org we can see: panic: The value in this file represents the number of seconds the kernel waits before rebooting on a panic. When you use the software watchdog, the recommended setting is 60. From here one can concl...
The authoritative source is the implementation in the kernel, so let’s look at that first. The panic entry in sysctl corresponds to a kernel variable called panic_timeout. This is a signed integer, used to control behaviour on panic as follows: if panic_timeout is strictly positive, the kernel waits after a panic, fo...
Linux Kernel.org misleading about kernel panic /proc/sys/kernel/panic
1,327,810,934,000
I tried looking into /proc/sys/vm/max_map_count file and it says 'empty' I have added a line vm.max_map_count=16777216 in etc/sysctl.config and want to see if changes are applied. I have certain problem with enlarging it being necessery to fix out of memory crashes in application and they still occur so i want to cros...
You can’t open files under /proc/sys with tools which check their length; they appear as 0-byte files. To check the current value, run cat /proc/sys/vm/max_map_count or /sbin/sysctl vm.max_map_count
How to display current vm.map_max_map_count value?
1,327,810,934,000
Is it possible to set Linux kernel sysctl settings (those usually set in /etc/sysctl.d) using kernel command line (those visible in /proc/cmdline)? (Using grub config file /etc/default/grub variable GRUB_CMDLINE_LINUX="...".)
Sysctl parameters can be set via the kernel command-line starting with kernel version 5.8, thanks to Vlastimil Babka from SUSE. sysctl.*= [KNL] Set a sysctl parameter, right before loading the init process, as if the value was written to the respective /proc/sys/.....
How to set sysctl using kernel command line parameter?
1,327,810,934,000
There's a binary that I need to run which uses bind with a port argument of zero, to get a random free port from the system. Is there a way I can constrain the range of ports the kernel is allowed to pick from?
on Linux, you'd do something like sudo sysctl -w net.ipv4.ip_local_port_range="60000 61000" instruction for changing ephemeral port range on other unices can be found for example at http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
How to limit range of random port sockets?
1,327,810,934,000
I have a server that has some VMs, but the VMs can't communicate properly with the server because the server has several interfaces, and it responds on the wrong one. Q: We know that there is a kernel parameter that can ensure that ARP responses will come only from that interface where the request went. What is that s...
You need to execute: sysctl -w net.ipv4.conf.all.arp_filter=1 This can be useful reading: Multiple network interfaces and ARP flux
sysctl parameter for correct ARP response
1,327,810,934,000
I have been testing Linux 4.18.16-200.fc28.x86_64. My system has 7.7G total RAM, according to free -h. I have default values for the vm.dirty* sysctl's. dirty_background_ratio is 10, and dirty_ratio is 20. Based on everything I've read, I expect Linux to begin writeout of dirty cache when it reaches 10% of RAM: 0.7...
Look at Documentation/sysctl/vm.txt: dirty_ratio Contains, as a percentage of total available memory that contains free pages and reclaimable pages, the number of pages at which a process which is generating disk writes will itself start writing out dirty data. The total available memory is not equal to total sys...
Writeback cache (`dirty`) seems to be limited to even less than dirty_background_ratio. What is it being limited by? How is this limit calculated?
1,327,810,934,000
We know that sysctl command can change kernel parameters with : # sysctl -w kernel.domainname="example.com" or by directly editing the file in /proc/sys directory. And for persistent changes, the parameters must be written to /etc/sysctl.d/<moduleName>.conf files as: # echo kernel.domainname="example.com" > /etc/sysc...
As far as I know, you can use modprobe to adjust parameters only when the feature in question has been compiled as a module - and you're loading the module in the first place. For setting module parameters persistently, you'll have the /etc/modprobe.d directory. (Generally you should leave /usr/lib/modprobe.d for dist...
Difference between modprobe and sysctl -w in terms of setting system parameters?
1,327,810,934,000
I want to change two values using sysctl. One is the sysctl vm.swappiness=10 and the other, sysctl kernel.sysrq=1. However, when I run sysctl -p, it tells me sysctl: cannot open "/etc/sysctl.conf": No such file or directory, but sysctl -a returns this. So, I want to ask where is my system storing sysctl config?
The configuration has long moved to /etc/sysctl.d/* You can create individual files, e.g. cat /etc/sysctl.d/swappiness.conf vm.swappiness=10 As for the sysctl -a output - you're seeing the current kernel values.
If /etc/sysctl.conf doesn't exist, where is my sysctl storing configs?
1,327,810,934,000
I am running Fedora 27 with kernel 4.14.5 and have a problem that /etc/sysctl.conf is not being loaded upon boot. If I run: sudo sysctl -p after boot, my settings are loaded and everything works fine. What do I need to do to enable the loading of /etc/sysctl.conf or what alternatives are there to load it?
In systemd operating systems like Fedora, loading these settings is done with the systemd-sysctl commmand, run by the systemd-sysctl service. Your problem is that you have put the settings in the wrong configuration file. systemd-sysctl does not read /etc/sysctl.conf. It reads a whole bunch of *.conf files in (among...
Fedora /etc/sysctl.conf not loaded upon boot
1,327,810,934,000
I know there's *.conf file in /usr/lib/sysctl.d and/or /etc/sysctl.d folders ready to establish kernel parameters on boot. But they are general; what I want is to customize some of these parameters (say, net.ipv4.icmp_echo_ignore_all) depending on the user who is in, but I want per-user kernel parameters. Is it possi...
What @Tomasz says it's true: those are kernel parameters, so they are "unique"! Anyway, you can achieve some result with that limit ...in the OP, @Osqui doesn't say users are simultaneously logged in... by sketching out a script executed when users login/logout using the sysctl command
Customize sysctl parameters by user
1,327,810,934,000
Where can I find the official documentation that sysctl.conf is last match based? So, there are two entries in the /etc/sysctl.conf file: vm.swappiness=10 vm.swappiness=11 Which will win? The last one? What happens if there are files in the /etc/sysctl.d directory?
I don’t think there is any such official documentation. sysctl entries are handled by procps and systemd; but neither projects’ documentation address how entries are processed within the same configuration file. The short version is that the last entry in sysctl.conf wins, even when other files are present (in /etc/sy...
Is sysctl.conf last match?
1,327,810,934,000
When I run lsmod or sudo lsmod, I get an error that says: libkmod: ERROR ../libkmod/libkmod-module.c:1655 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory Error: could not get list of modules: No such file or directory I searched on a lot of forums but am unable to find a solution ...
In both cases, you’re trying to interact with the kernel. Any Linux environment running on WSL isn’t running a Linux kernel, it’s running on the Windows kernel; so anything tied to the Linux kernel (including modules and system controls) won’t work. In the IPv6 case, you need to configure the network using Win...
lsmod gives error: "could not get list of modules" on Debian running on WSL
1,327,810,934,000
This is on the Linux OS. I see that on some machines the net.bridge.bridge-nf-call-iptables variable doesn't exist until I modprobe the br_netfilter filter. I also see that there are some machines where the bridge module is loaded and that itself brings in this variable. Is there a way to know which module I should lo...
There's no automatic database relating sysctl variables to modules. You can search the module binary and hope that the variable name isn't found in other strings (this one isn't). Search for the last part, i.e. bridge-nf-call-iptables — the full string isn't present in the binary, it's constructed dynamically. grep -r...
Kernel module for net.bridge.bridge-nf-call-iptables
1,327,810,934,000
What's the prescribed way to set Linux kernel runtime parameters? I've seen sometimes that people will set these in files such as /etc/rc.local. Is this really the right way to do this?
You can use sysctl to set some of the kernel parameters, specifically the ones under /proc/sys. These can be set in the file /etc/sysctl.conf or added to a single file (the preferred method on some distro's such as Fedora) in the directory /etc/sysctl.d. On distros that have this directory it's meant for customization...
What's the right way to set Linux kernel runtime parameters?
1,327,810,934,000
Is setting in /etc/sysctl.conf: vm.swappiness=0 equivalent (except that it's persistent) to running swapoff -a, *in Linux kernels >= 3.5? *in earlier kernel versions, 0 meant 'no swapping until out of memory'.
No. swapoff -a completely turns off swapping. swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible
Is `vm.swapiness=0` equivalent to `swapoff -a` (in kernel >= 3.5)
1,327,810,934,000
The sysctl utility allows a Linux admin to query and modify kernel parameters in runtime. For example, to change the swappiness of a Linux system to 0, we can: echo 0 > /proc/sys/vm/swappiness Or we can use sysctl: sysctl -w vm.swappiness=0 To make the value persistent, Archwiki suggests to write vm.swappiness=0 ...
The number at the beginning of the name of configuration files is used as an easily readable way to sort them, with the aim of defining the order of precedence among the entries they contain. From man 5 sysctl.d1 (emphasis mine): CONFIGURATION DIRECTORIES AND PRECEDENCE ... All configuration files are sorted by their...
What does the number in sysctl configuration file denote?
1,327,810,934,000
I saw in my syslog kernel.perf_event_max_sample_rate get changed. I was wondering if I could write a quick script to log this variable every few minutes. Currently it is: sysctl -a | grep kernel.perf_event_max_sample_rate In the man page sysctl says sysctl - configure kernel parameters at runtime Does that mean tha...
So one of the big things about learning to Unix is reading the bloody man page: I'm not just being a get off my lawn grumpy old man, there REALLY IS valuable information in there. In this case: DESCRIPTION sysctl is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sy...
View current kernel parameters?
1,327,810,934,000
when we run the sysctl -p on our rhel 7.2 server1 we get sysctl -p fs.file-max = 500000 vm.swappiness = 10 vm.vfs_cache_pressure = 50 sysctl: cannot stat /proc/sys/pcie_aspm: No such file or directory net.core.somaxconn = 1024 # ls /proc/sys/pcie_aspm ls: cannot access /proc/sys/pcie_aspm: No such file or directory ...
As revealed in the comments, there’s a pcie_aspm=off line in one of the files which sysctl -p reads. This causes sysctl to attempt to write to /proc/sys/pcie_aspm; if that doesn’t exist (and it won’t, it’s not a valid sysctl entry, it’s a kernel boot parameter), you’ll get the error shown in your question.
sysctl -p failed on /proc/sys/pcie_aspm
1,327,810,934,000
sysctl has this -w switch. Is it really needed? I tried to do: sysctl vm.max_map_count=262144 And it seems to have worked out.
For the Linux sysctl, from procps-ng, this was reported a year ago, and the manpage fixed: The w flag is not needed for key=val type options but only forces all options to be that format. Now the manpage reads: -w, --write Use this option when all arguments prescribe a key to be set.
Is -w option of sysctl really needed when changing kernel parameters?
1,327,810,934,000
How can i change a parameter for all interfaces in systemd ? For example: sysctl -w "net.ipv4.conf.eth0.rp_filter=0" sysctl -w "net.ipv4.conf.eth1.rp_filter=0" How can change it for all interfaces ?
Try all and default: # sysctl -w "net.ipv4.conf.all.rp_filter=0" # sysctl -w "net.ipv4.conf.default.rp_filter=0" This is explained in the Kernel documentation: conf/default/*: Change the interface-specific default settings. conf/all/*: Change all the interface-specific settings. However note that putting a...
Change sysctl parameters for all interfaces
1,327,810,934,000
I'm famillar with iptables -F and other features of iptables. I need to disable iptables from kernel, of course I prefer to disable from sysctl instead of recompiling the kernel.
If your kernel uses modules for iptables, which is the case in most distributions, you can blacklist the base module; create a file named, for example, /etc/modprobe.d/iptables-blacklist.conf, containing install ip_tables /bin/false You can block other variants in a similar fashion (ip6_tables, ebtables, nf_tables et...
How to disable iptables from kernel
1,327,810,934,000
In a previous question and answer, I showed an experiment about dirty_ratio. Writeback cache (`dirty`) seems to be limited to even less than dirty_background_ratio. What is it being limited by? How is this limit calculated? I thought I solved the question, by correcting my understanding of the dirty ratio calculation....
The "ratios" refer to the size of the dirty page cache aka write-back cache, as a percentage of MemFree + Cached. They are not a percentage of MemTotal - this was what confused me in the above question. No. This description is still inaccurate. Cached includes all files in tmpfs, and other Shmem allocations. They ...
Writeback cache (`dirty`) seems to be limited below the expected threshold where throttling starts. What is it being limited by?
1,532,542,957,000
Many of the kernel parameters have default values assigned. But some of them aren't really clear. I'm reading the proc manual and in the case of admin_reserve_kbytes we can read the following: The default value in this file is the minimum of [3% of free pages, 8MiB] expressed as KiB. There are other similar defaul...
Some time during kernel boot - when the MM subsystem is initialized - it calculates 3% of the remaining free memory. If that is more than 8MiB, the value is set to 8MiB. Hence we say the value is set to the minimum of the two. This is a one-time initialization; it is never re-calculated. https://elixir.bootlin.com/...
What's the default value of the admin_reserve_kbytes kernel parameter?
1,532,542,957,000
In the process of trying to fix an issue, I accidentally deleted /sbin/sysctl when I was intending to delete /etc/sysctl.conf. When I run sysctl I get the error that says The program 'sysctl' is currently not installed. You can install it by typing: sudo apt-get install procps When I try both install and upgrade it...
You can use the --reinstall flag to apt-get apt-get --reinstall install procps
Restore part of a package that was accidentally deleted
1,532,542,957,000
What is the main difference between systemd-sysctl vs sysctl and when to use either? Both are present in my debian based system.
sysctl is an administrative tool which provides access to values in the /proc/sys virtual file system (see also How to set and understand fs.notify.max_user_watches). You can use it to see the current value of a setting: sysctl fs.inotify.max_user_watches and to change the value: sysctl fs.inotify.max_user_watches=52...
Diffence between `systemd-sysctl` and `sysctl`
1,532,542,957,000
What are the differences between sysctl variables net.inet.ip.forwarding and net.inet.ip.redirect?
Setting ip_forwarding to 1 enables the kernel to route packets. Basically your host will become a router. Setting ip_redirect to zero disables the kernel to sending or receiving icmp-redirects, which will occur if some host (or this host) finds a better route for a packet.
Differences between forwarding and redirect in net.inet.ip
1,532,542,957,000
I understand that, for security reasons (like address randomization), it makes some sense to not let every user be able to read the kernel's dmesg. Linux allows one to restrict dmesg to the root user using: sysctl -w kernel.dmesg_restrict = 1. That sysctl forces everyone who wants to use dmesg to prepend sudo, which i...
If, by "sudoless", you mean you want to be able to just write dmesg or such on the command line, then the simplest solution would be to make a script that calls /bin/dmesg through sudo, and configure sudo to let that happen without asking for a password. So, something like this: echo 'username ALL = NOPASSWD:/bin/dmes...
Can I restrict dmesg to a group?
1,532,542,957,000
I understand the difference between /proc/sys/kernel/pid_max and /proc/sys/kernel/threads-max. There's a good explanation at the answer to Understanding the differences between pid_max, ulimit -u and thread_max: /proc/sys/kernel/pid_max has nothing to do with the maximum number of processes that can be run at any giv...
These settings don’t have the same effect: threads-max limits the number of processes which can be instantiated simultaneously pid_max limits the identifier assigned to processes threads-max limits the amount of memory that can end up allocated to task_struct instances. pid_max determines when pids roll around (if e...
Why does Linux needs both pid_max and threads-max?
1,532,542,957,000
The NOTES section of $ man 5 sysctl.conf states: The description of individual parameters can be found in the kernel documentation. But is there a way for me to find this kernel documentation offline? Is it a package that I'd need to install? For example, I came across the kernel.panic parameter, which on my system is...
But is there a way for me to find this kernel documentation offline? Is it a package that I'd need to install? Yes, most distributions provide the kernel documentation for their kernel in a package. On Debian, this is linux-doc, which is a meta-package pulling in the default kernel’s documentation for whichever rele...
Where to get offline documentation/descriptions of individual sysctl kernel tunable parameters?
1,532,542,957,000
As root, I try to attach strace to a running kworker process, without success. root@rasal# whoami root root@rasal:/# cat /proc/sys/kernel/yama/ptrace_scope 0 root@rasal:/# ps ax | grep kworker 1030 ? S< 0:00 [kworker/u17:0] root@rasal:/# strace -f...
The kworker "process" that you show is a kernel thread and not a normal process. There is no userspace portion for it and thus no syscalls. Even if it worked it couldn't possibly show anything. On top of everything else, I guess that tracing kernel threads (under whatever fictional scenario one can imagine) would most...
Why am I unable to attach `strace` to a kworker process?
1,532,542,957,000
It is well known that OpenBSD disables hyper-threading by default. However, htop shows 16 CPUs: 8 online and 8 offline, which takes extra space on the screen and is not very informative. Moreover, sysctl also sees 16 logical CPUs. This doesn't make sense to me: with hyperthreading disabled, it's an 8-core 8-thread pr...
Availability of hyperthreading is managed from BIOS/EFI. What OpenBSD do is to put offline the processor(s)/thread(s). So You should do it in BIOS/EFI by disabling hyperthreading option.
How to disable logical processors in OpenBSD?
1,532,542,957,000
I am benchmarking the write performance in the case that Linux writes the data to the page cache without throttling the process or syncing the data to the disk. The simple experiment I am doing looks like the following: long size = 1024; int fd = open ("file", O_CREAT | O_RDWR | O_TRUNC, ...); char *buffer = (char *) ...
The main factor here is that memcpy is handled by the C library, or even directly by the C compiler, whereas write is a system call, handled by the kernel. So your memcpy runs in-process, possibly without even the (tiny) overhead of a function call. write, on the other hand, has all the overhead of a system call. In y...
Linux Page Cache Performance versus memcpy
1,532,542,957,000
When I run podman I get, $ podman info cannot clone: Operation not permitted user namespaces are not enabled in /proc/sys/kernel/unprivileged_userns_clone Error: cannot re-exec process How can I enable user namespaces and have them persist after reboot? I am using Debian.
You can enable user namespaces like this, sysctl -w kernel.unprivileged_userns_clone=1 And you can have it persist after reboot in Debian by running this, echo "kernel.unprivileged_userns_clone=1" >> /etc/sysctl.conf
How can I enable user namespaces and have it persist after reboot?
1,532,542,957,000
Running CentOS 5.5 with Puppet 0.25.5 I have installed and am using the puppet-sysctl module. However the following error occurs: //linux_tuning/Sysctl::Value[net.core.rmem_default] Sysctl[net.core.rmem_default] (err): Failed to retrieve current state of resource: No ability to determine if sysctl exists //linux_tunin...
Looks like you need to enable pluginsync: In puppet.conf: [main] pluginsync = true
Puppet problem with sysctl
1,532,542,957,000
I cannot explain this, I will start by listing these speed test results this one is the linux host running mxlinux latest version this one is the windows 10 running inside vmware on the same computer I'm trying to figure out why it's THAT bad on linux I have tried the web interface, I'm getting the same kind of resu...
I don't know why under Linux the speed test is using only one CPU for my Mikrotik but I was able to fix the slowdown by upgrading to 7.x (at minimum >= 7.2) to be able to use fast-track under VLAN filtering at the bridge level.
strange issue, worst network speed and worst ping latency on linux
1,532,542,957,000
Today I ran into some code that's writing a newline character explicitly into a sysctl file. See moby/docker source code. My first thought is that the author has diligently copied the shell's behaviour into go despite the newline being redundant. But then I started to look for documentation on the subject and found ...
In most cases it shouldn’t make any difference either way, at least at the end of an input string. In all cases, only written data is processed — the kernel knows how long the supplied buffer is (1 byte for 1 with no newline, 2 for 1 with a newline) and will only process that many bytes. sysctl entries using the stand...
Does writing a newline character into a sysctl (/proc/sys) file have any effect?
1,532,542,957,000
I've been using /proc/self for a long time to read process-related information like /proc/self/maps etc. However, on some UNIX variants, like macOS, the procfs filesystem is not implemented; but as this link states, it should be possible to obtain similar information using sysctl. Reading output from sysctl -a, I find...
Your observation that sysctl predominantly contains system-wide parameters is apt. It also follows somewhat from the name sysctl (which suggests SYStem ConTroL), and the man page's description of "sysctl - get or set kernel state." Some BSD systems do offer optional procfs filesystem support which can be mounted unde...
How to use sysctl on UNIX variants, e.g. macOS, to read information normally found in /proc/self on Linux?
1,532,542,957,000
I am going to install oracle database 12c on oracle linux 7.5. In the process, I have to edit following kernel parameters and set values. fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 90...
Edits to the file /etc/sysctl.conf normally will only affect the system upon reboot unless you run by hand: sudo sysctl -p If you want to set a particular kernel variable at run time, do: sudo sysctl -w kernel.shmmni=4096 If you want to see all the kernel variables, do: sysctl -a
editing sysctl.conf on oracle linux 7.5
1,532,542,957,000
I want to grep a particular kernel setting as follows $ sudo sysctl -a --ignore | grep -i max_map_count 2>/dev/null sysctl: reading key "net.ipv6.conf.all.stable_secret" sysctl: reading key "net.ipv6.conf.default.stable_secret" sysctl: reading key "net.ipv6.conf.docker0.stable_secret" sysctl: reading key "net.ipv6.con...
You are redirecting the stderr of the grep to /dev/null but the stderr messages are coming from sysctl. Try sudo sysctl -a --ignore 2>/dev/null | grep -i max_map_count
sysctl command returning info not asked about
1,532,542,957,000
I ran c1000k on my CentOS 7.2 machine and it told me connections: 921 error: Too many open files Because of this I changed my /etc/sysctl.conf to contain this: fs.file-max = 2097152 But even after a reboot I still run into the same limit. ulimit -Sn and ulimit -Hn print 1024 respectively 4096.
The effective (soft) 1024 descriptor ulimit is a total for the process, including descriptors that are used for non-connection purposes. Apparently that process is using about 100 descriptors for other things, leaving only 921 for connections. lsof -p <process-id> will show you how the descriptors are being used. To...
Less than 1000 possible connections although I updated sysctl
1,532,542,957,000
I have found that the value of net.netfilter.nf_conntrack_count variable change every time i reboot the system. Did any one have an explanation for that?
As one can lookup in Documentation/networking/nf_conntrack-sysctl.txt, this variable is not really a sysctl variable to tweak system behavior, but to read-only variable telling you something about kernel state, in this case: nf_conntrack_count - INTEGER (read-only) Number of currently allocated flow entries. Thi...
Sysctl parameter change after every reboot
1,532,542,957,000
/etc/security/limits.conf looks like this #<domain> <type> <item> <value> # #* soft core 0 #* hard rss 10000 #@student hard nproc 20 #@faculty soft nproc 20 #@faculty hard nproc 50 #ftp ...
According to the documentation, and to my quick reading of the source code, a backslash has no special meaning here. Since \* is not a range, does not start with any of the recognized special characters @%, and is not the exact string *, the domain is interpreted as a user name. Note that the user name is \*, not *. T...
what is the meaning of backslash in /etc/security/limits.conf
1,532,542,957,000
I found this answer that says I can enable/disable multicast snooping by writing to /sys/devices/virtual/net/br-lan/bridge/multicast_snooping "or in sysctl.conf". I'd like to make it permanent but I can't work out what this value is called in sysctl.conf. How do I figure out what multicast_snooping is called in sysctl...
There is no equivalent. I suspect the mention of sysctl comes from a misconception and wasn’t actually tested. multicast_snooping is a device attribute exposed through sysfs, typically mounted on /sys, whereas sysctl accesses sysctl variables exposed in /proc/sys. It is technically possible for the same setting to be ...
How to find sysctl.conf option name from /sys/devices path?
1,532,542,957,000
As I spawn several processes in a loop, I hit the maximum number of open files handles and the for loop breaks. When I count the open file handles using lsof I get: $ lsof | wc -l 1464377 However checking fs.file-nr returns: $ sysctl fs.file-nr fs.file-nr = 35328 0 6553201 I expected the first number to b...
as per man lsof An open file may be a regular file, a directory, a block special file, a character special file, an executing text reference, a library, a stream or a network file (Internet socket, NFS file or UNIX domain socket.) A specific file or all the files in a file system may be selected ...
Open file handles
1,532,542,957,000
While trying to read some kernel parameters, I think I have mistakenly set some instead: # sysctl --system -r ^net.*tcp * Applying /usr/lib/sysctl.d/00-system.conf ... * Applying /usr/lib/sysctl.d/50-default.conf ... kernel.sysrq = 16 kernel.core_uses_pid = 1 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.a...
During a boot sysctl settings are initially set to default values hardcoded into the kernel. You most likely don't want to revert to these, as system specific settings are loaded from the various system configuration files by a sysctl init script, in a manner similar to the command you executed, except not limited to ...
How to undo kernel settings?
1,532,542,957,000
I tried the following: sysctl -w net.ipv6.conf.Ethernet1.200.disable_ipv6=0, but it gave following error: sysctl: cannot stat /proc/sys/net/ipv6/conf/Ethernet1/200/disable_ipv6: No such file or directory It should have ideally tried to change in /proc/sys/net/ipv6/conf/Ethernet1.200/disable_ipv6 which it is not I hav...
Because sysctl.conf uses dots as filesystem path separators, you have to use / in place of actual dots. Yes, it's weird like that. net.ipv6.conf.Ethernet1/200.disable_ipv6 = 0 But you can actually use / as the separator, too: net/ipv6/conf/Ethernet1.200/disable_ipv6 = 0 I would honestly suggest not disabling IPv6 by...
How to enable IPv6 on subinterface in Linux using sysctl?
1,532,542,957,000
I'm increasing the watch limit on my RHEL 7 server and I'd like my changes to take effect without having to reboot. I've updated the /etc/sysctl.conf file so that the changes will be permanent. If I run sysctl -p after updating the systcl.conf file, will the new watch limits be applied to services that are currently...
From man page: -p Load in sysctl settings from the file(s) specified or /etc/sysctl.conf if none given. Specifying - as filename means reading data from standard input. YES. the new watch limits are applied to services that are currently running
do you have to restart services after running sysctl -p?
1,532,542,957,000
What are the default kernel parameters, when creating a new network namespace? Is there a way to override them upon creation? I think they are inherited by the parent process. An example using unshare: > /sbin/sysctl -a --pattern 'net.ipv4.conf.all.forwarding' net.ipv4.conf.all.forwarding = 1 > unshare -n > /sbin/sysc...
I think your surmise is correct, they are inherited from the parent namespace. This seems similar to how processes clone themselves using the fork() system call, then any desired changes have to be applied by the clone, using the normal system calls. (Including replacing the current program with a completely differe...
Default kernel parameters on new network namespaces
1,532,542,957,000
I'm trying to assign an empty string to a system setting, but it fails: [root@wc8rh7 ~]# sysctl -w net.ipv4.ip_local_reserved_ports="50000" net.ipv4.ip_local_reserved_ports = 50000 [root@wc8rh7 ~]# sysctl -w net.ipv4.ip_local_reserved_ports="" sysctl: malformed setting "net.ipv4.ip_local_reserved_ports=" Using procfs...
I agree with thrig, this does look like a bug. Writing directly to procfs is an obvious workaround. If you need to use the sysctl utility, another workaround is to add a newline: sysctl -w net.ipv4.ip_local_reserved_ports=" " A trailing newline has no effect on most if not all sysctl settings.
sysctl: malformed setting "net.ipv4.ip_local_reserved_ports="
1,697,182,102,000
I tried disabling IPv6 using /etc/sysctl.conf and after a reboot I cannot get into any of the two DE that I have installed (I am using Pop! OS 20.04). Tried both Pop Desktop and KDE Plasma. The SSDM login screen does show up but after successfully logging in I get a black screen and only the cursor is visible. Ctrl + ...
Create a file called e.g. /usr/share/xsessions/safemode.desktop [Desktop Entry] Encoding=UTF-8 Name=Safemode (Xterm) Comment= Exec=xterm Terminal=False TryExec=xterm [Window Manager] SessionManaged=true Restart SDDM or reboot. Log into "Safemode (Xterm)". Now run: startplasma-x11 or env GNOME_SHELL_SESSION_MODE=pop ...
Disabling IPv6 leads to black screen on reboot
1,697,182,102,000
There are a lot of network-related settings in /etc/sysctl.conf and a number of files in /etc/sysctl.d/. My data centre operator who has preconfigured the Ubuntu OS to work best in their environment has also added a custom file in there. I guess they come in a good state with the OS and I only need to make changes the...
Here's a partial answer about what I found out so far. Reading the source code of UFW, I found it just loads in the settings from its own config file when UFW starts. This means that at this point, it will add all settings from that file to the already existing configuration. This will override just the values that ar...
Why does UFW use a different sysctl.conf file?
1,697,182,102,000
I would like to edit the file aio-max-nr: root@node:~# echo 65536 > /proc/sys/fs/aio-max-nr -su: /proc/sys/fs/aio-max-nr: Permission denied Knowing that : root@node:~# ls -lrth /proc/sys/fs/aio-max-nr -rw-r--r-- 1 root root 0 Nov 22 17:02 /proc/sys/fs/aio-max-nr I don't understand why !
My guess is that you're running in a Linux-on-Linux soft virtualization environment such as LXC or OpenVZ where all virtual machines run above the same instance of the Linux kernel. In this kind of environment, kernel parameters (such as the sysctl parameters that you can set via /proc/sys) apply to every virtual mach...
Permission denied on aio-max-nr file
1,697,182,102,000
When editing configuration files, such as /etc/sysctl.conf for example, it is often useful to do the update in an idempotent way, meaning that if the script is executed multiple times, you don't end up with multiple entries for the configuration change you made. As a real-world instance where I encountered this, I nee...
Instead of running shell commands, use the sysctl module. If possible, avoid using shell. - ansible.posix.sysctl: name: vm.swappiness value: '10' state: present
Edit configuration files idempotently
1,697,182,102,000
I hope to check the value of log_buf_len via sysctl, but sysctl -a doesn't show it, why and is there any other way to check its value
The value of log_buf_len is set once and for all when the kernel is configured and built OR when it is booted with a parameter log_buf_len=NNN: you cannot change it after that. sysctl generally concerns itself with things that you can change in the running kernel: that's probably the reason why log_buf_len is not incl...
sysctl -a doesn't include log_buf_len
1,697,182,102,000
For example, if I set oops=panic in grub command and I also set kernel.panic_on_oops=0 in sysctl config? ex: in /etc/sysctl.d/ What would happen? Are these two parameters mapping to the same function/feature in the kernel? Why not use the same variable name?
sysctl settings are applied after boot, so in most cases they override equivalent settings given on the kernel command-line (the exceptions are values which can only be set once). Both the kernel oops argument and the kernel.panic_on_oops sysctl map to the same variable, panic_on_oops. This is set by oops_setup if a v...
What if kernel parameter conflicted in grub and sysctl?
1,697,182,102,000
When I used to copy a data over a thumb-drive, even if the writing speed can't exceed 2 MiB/s to the thumb-drive, Linux first copies 600 MB data to it in one second - it just writes to the RAM as cache, then it slowly flushes out the data for like 300 seconds. Caching doesn't actually increase the copy speed in such c...
Without that cache, the HDD can't reorganize writes, which leads to much fragmentation and much more wear. Instead of turning off the cache, you can mount your stick with sync option.
Is there any long-term side effect of setting vm.dirty_ratio to 0?
1,697,182,102,000
When I disable IPV6 on my Debian install I can't reach the internet, and whenever I ping anything I get ping: unknown host ... This is how I am currently disabling IPV6 net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 in my /etc/sysctl.conf
The root of this problem was that in my /etc/resolv.conf I had domain hsd1.XX.comcast.net as the first entry which was IPV6, and so I had no DNS. I fixed the problem by simply commenting that line out with a #.
Can't ping anything when IPV6 is disabled
1,697,182,102,000
We have a ruby application that started throwing lot of "unable to create new socket: Too many open files" errors recently I have updated "etc/security/limits.conf" as below root soft nofile 6553600 root hard nofile 6553600 nobody soft nofile 655360 nobody soft nofile 655360 mysql hard nofile 655360 mysql hard nofi...
I have updated /etc/security/limits.conf as below That's read by pam_limits.so, so it only takes effect for anything that goes through PAM, as in a user login. updated /etc/sysctl.conf That's likely read by some boot scripts, so the changes only take effect after a reboot... (There's systemd-sysctl.service and an...
ulimit value not changing for a process
1,697,182,102,000
When I configure the vm.watermark_scale_factor property in /etc/sysctl.conf which is the property in charge of indicating to the kernel when the kswapd daemon starts to activate for paging from ram to disk, something happens that I can't find an explanation for: it increases the consumption of ram memory. If I leave i...
The vm.watermark_scale_factor property in the Linux kernel controls how the kernel manages the available RAM in the system. Increasing the value of this property sets a higher threshold for memory usage before the kernel begins to release inactive memory or file cache in the system. This higher threshold means that th...
Why does setting the vm.watermark_scale_factor property increase ram consumption?
1,697,182,102,000
The Linux kernel's documentation on its Key Retention Service states that: /proc/sys/kernel/keys/maxkeys /proc/sys/kernel/keys/maxbytes These files hold the maximum number of keys that each non-root user may have and the maximum total number of bytes of data that each of those users may have stored in their keys. Th...
The answer is: Per user. See the demonstration below: ┌[rovanion][RiggenBuntu]:~ └$ keyctl add user a-key some-data @u 812046028 ┌[root][RiggenBuntu]:/ └# cat /proc/key-users 0: 95 94/94 83/1000000 1687/25000000 1000: 5 5/5 5/200 61/20000 ┌[root][RiggenBuntu]:/ └# sysctl -w kernel.keys.maxbytes=62 kernel....
Is kernel.keys.maxkeys per user or per key?
1,697,182,102,000
on some of my machines i have this block of setting in sysctl.conf(the numbers are different on each machine) : #Size Of RAM (In GB): 23 kernel.shmmni= 2547 kernel.shmmax= 365482458 kernel.shmall= 25471984 #kernel.sem=<SEMMSL> <SEMMNS> <SEMOPM> <SEMMNI> kernel.sem= 325 12496852 74 3654 kernel.msgm...
If that is the only place in the file where those lines appear: sed '/#Size Of RAM (In GB): 23/,/kernel.msgmnb/d' /etc/sysctl.conf That searches for everything in between and including the first and last lines of that block and deletes it. I included the first line in its entirety instead of a smaller string in cas...
remove specific sysctl.conf setting
1,697,182,102,000
Is it right to comment line with # in the file sysctl.conf? I ask because I am not sure if the comment lines would be read or not. more /etc/sysctl.conf #net.core.rmem_default = 1048576 #net.core.rmem_max = 4194304 #net.core.wmem_default = 1048576 #net.core.wmem_max = 4194304 net.ipv4.tcp_timestamps=0 net.ipv4.tcp_...
An excerpt from man sysctl.conf: Comments are denoted by a "#" at the beginning of a line.
linux + sysctl.conf configuration