Amal KM

1668405649

CloudLinux Disable Ptrace

How can Ptrace be turned off in a shared environment of CloudLinux OS? With this article, let's investigate the solution. As part of our server management services, Skynats provides answers to all of your questions.

How do I disable Ptrace on CloudLinux?

Ptrace, also known as Process trace, is a debugging feature that enables the communication between processes. Additionally, it checks or modifies the running state and memory. One process (the "tracer") can watch over and manage the operation of another process (the "tracee") using the ptrace() system function. The memory and registers of the tracee can also be seen and modified. It is primarily utilized for system call tracing and breakpoint debugging.

By taking advantage of a privileged app while it is performing a privileged operation, unprivileged users can use the ptrace() function to obtain privileged access. An attacker may be able to use ptrace or other tools to connect to and modify a setuid process that is already running as a result. With admin access, the attacker can now run his code. This makes every Linux product that depends on this kernel weak.

Solution

In the CloudLinux OS Shared, the ptrace() is turned on by default. The default setting is as follows:

kernel.user_ptrace = 1

kernel.user_ptrace_self = 1
 

To disable PTRACE ATTACH, we can use the kernel.user ptrace. Additionally, we can disable PTRACE TRACEME by using a kernel.user ptrace self.

Even so, we must add this to the /etc/sysctl.conf file and alter both sysctl options to 0.

## CL. Disable ptrace for users

kernel.user_ptrace = 0

kernel.user_ptrace_self = 0

##

After that, we must apply the modifications made with $ sysctl -p.

In this case, ptrace protection will only be partially available. Access levels to the ptrace may vary depending on the software. To make them work, we might only need to set one parameter to 0.

What is GEEK

Buddha Community

Amal KM

1668405649

CloudLinux Disable Ptrace

How can Ptrace be turned off in a shared environment of CloudLinux OS? With this article, let's investigate the solution. As part of our server management services, Skynats provides answers to all of your questions.

How do I disable Ptrace on CloudLinux?

Ptrace, also known as Process trace, is a debugging feature that enables the communication between processes. Additionally, it checks or modifies the running state and memory. One process (the "tracer") can watch over and manage the operation of another process (the "tracee") using the ptrace() system function. The memory and registers of the tracee can also be seen and modified. It is primarily utilized for system call tracing and breakpoint debugging.

By taking advantage of a privileged app while it is performing a privileged operation, unprivileged users can use the ptrace() function to obtain privileged access. An attacker may be able to use ptrace or other tools to connect to and modify a setuid process that is already running as a result. With admin access, the attacker can now run his code. This makes every Linux product that depends on this kernel weak.

Solution

In the CloudLinux OS Shared, the ptrace() is turned on by default. The default setting is as follows:

kernel.user_ptrace = 1

kernel.user_ptrace_self = 1
 

To disable PTRACE ATTACH, we can use the kernel.user ptrace. Additionally, we can disable PTRACE TRACEME by using a kernel.user ptrace self.

Even so, we must add this to the /etc/sysctl.conf file and alter both sysctl options to 0.

## CL. Disable ptrace for users

kernel.user_ptrace = 0

kernel.user_ptrace_self = 0

##

After that, we must apply the modifications made with $ sysctl -p.

In this case, ptrace protection will only be partially available. Access levels to the ptrace may vary depending on the software. To make them work, we might only need to set one parameter to 0.

CentOS, what are you doing? CentOS Stream, Rocky Linux, and CloudLinux

How to Convert CentOS 8 to CentOS Stream
Okay, so you probably have a few CentOS 8 machines either in production or just sitting around. At some point, that distribution will be deprecated and will no longer receive updates. If you’d like to be one step ahead of that process, you can convert the CentOS 8 platform over to CentOS Stream with a few quick commands. Here’s how:

  1. Log into your CentOS 8 machine.
  2. Install the necessary repositories with the command sudo dnf install centos-release-stream.
  3. Make the new Stream repositories the default with the command sudo dnf swap centos-{linux,stream}-repos.
  4. Sync the installed packages with the available packages using the command sudo dnf distro-sync.

#linux #centos stream #art thou #rocky linux #cloudlinux

Tyshawn  Braun

Tyshawn Braun

1604164380

Beyond the frontiers of disabilities

The past two decades ignited the technological revolution we are living today. However, even though companies embraced it in public, most of them have been slow in adapting their workplaces. We’ve all heard about the famous paperless office, but employees are still drowning in a sea of paper. Process re-engineering was another buzz word, but customers still face manual systems with time-consuming processes at the backend. Remote working was the cornerstone of our technological advancement, yet employers were afraid of losing control, and their doubts extinguished these excellent initiatives.

Then the pandemic happened. Everyone was in shock and panic seeped in. The only solution was to switch online, quickly digitise our paperwork and start rethinking our processes. And companies realised that things weren’t so bad after all. As a matter of fact, before the pandemic, only 10% of the workforce primarily worked from home. When it finally passes, this number will increase to 25%. Furthermore, employers are more open to this alternative form of work because it carries several benefits such as downsizing office space, decreasing meeting hours, reducing business travel, and making office hours more flexible.

But there’s another benefit which many employers do not realise. The talent pool of potential employees suddenly increased by several folds. Workers do not need to reside in the country where they are working (if they can work remotely). Some countries like Bermuda, Croatia and many others are even offering working visas. But this pandemic is also opening up new horizons for another sector which has a lot of untapped potential; people with disabilities.

#disability #knowledge #artificial-intelligence #technology #data-science

Andre  Bradtke

Andre Bradtke

1625738160

How to Disable Command Prompt

To help support me, check out Kite! Kite is a coding assistant that helps you faster, on any IDE offer smart completions and documentation. https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=johnhammond&utm_content=description-only (disclaimer, affiliate link) Hang with our community on Discord! https://johnhammond.org/discord
If you would like to support me, please like, comment & subscribe, and check me out on Patreon: https://patreon.com/johnhammond010
E-mail: johnhammond010@gmail.com
PayPal: http://paypal.me/johnhammond010
GitHub: https://github.com/JohnHammond
Site: http://www.johnhammond.org
Twitter: https://twitter.com/_johnhammond

#disable #command prompt

Mike  Kozey

Mike Kozey

1668614609

How to Disable Button Tutorial in React

React: How to disable button tutorial

Here's how you disable a button using React


When you need to disable a button using React, you can simply add the disabled prop to your <button> element:

function App() {
  return <button disabled={true}>Click me!</button>;
}

Knowing this, you can easily modify the code according to your requirements to disable the <button>.

React disable button after click

For example, you may want to disable a <button> after it has been clicked. You can do so by adding a state that controls the value of disabled prop. Let’s name the state disable and set its default value to false:

const [disable, setDisable] = React.useState(false);

After that, you need to use the disable state value as the value of disabled prop in the <button> element.

Finally, add an onClick prop to the <button> element that will set the disable state to true.

The full code is as shown below:

import React from "react";
function App() {
  const [disable, setDisable] = React.useState(false);

  return (
    <button disabled={disable} onClick={() => setDisable(true)}>
      Click me!
    </button>
  );
}

With the code above, your button will be disabled once it receives a click event.

React disable button for login form

In another example, you may have a login button that you want to disable as long as the email and password <input> is empty.

You can easily do so by checking controlling the value of both <input> elements using the state.

When the value of email or password state is empty, the disabled prop value must be true. You can do so by using the following code:

disabled={!email || !password}

The following code example shows how to do it:

import React, { useState } from "react";

function App() {
  const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");

  const handleEmailChange = (event) => {
    setEmail(event.target.value);
  };

  const handlePasswordChange = (event) => {
    setPassword(event.target.value);
  };

  const handleSubmit = (event) => {
    event.preventDefault();
    alert(`Your state values: \n 
            email: ${email} \n 
            password: ${password} \n 
            You can replace this alert with your process`);
  };

  return (
    <form onSubmit={handleSubmit}>
      <div>
        <label>Email address</label>
        <input
          type="email"
          name="email"
          placeholder="Enter email"
          onChange={handleEmailChange}
          value={email}
        />
      </div>
      <div>
        <label>Password</label>
        <input
          type="password"
          name="password"
          placeholder="Enter password"
          onChange={handlePasswordChange}
          value={password}
        />
      </div>
      <button type="submit" disabled={!email || !password}>
        Login
      </button>
    </form>
  );
}

This way, your <button> element will be disabled as long as the value of email or password state is falsy

Conclusion

To conclude, you can disable a <button> element in React by setting the disabled prop to true.

Depending on the conditions required to disable the <button>, you can manipulate the disabled prop through various ways, such as by checking if the form values are empty or the <button> has been clicked by the user.

Original article source at: https://sebhastian.com/

#react #disable #button