• Webconn Technology
    • GPU Server
      • Dedicated GPU Servers with NVIDIA RTX/A100 GPUs for accelerated AI training, rendering, and scientific computing. Features CUDA cores, 24GB-141GB VRAM, and parallel processing. Pre-configured with TensorFlow/PyTorch.

      • nvidia rtx A6000
    • Dedicated Server
      • Experience blazing-fast speeds & ironclad security with your own dedicated server. No shared resources. Fully customizable plans for gaming, e-commerce, and big data. Start now!

      • datacenter
    • Shared Hosting
      • Get user-friendly DirectAdmin shared hosting for your website. Enjoy an intuitive control panel, one-click app installs, and reliable performance. Perfect for blogs, small business sites, and portfolios.

      • shared hosting web
    • Domains
      • Search and register the perfect domain name for your website. Get a memorable .com, .net, .org or niche TLD to start building your brand online. Includes free privacy protection.

    • VPS
      • Experience the power of a dedicated server without the high cost. Our VPS hosting guarantees CPU, RAM, and storage for your site, ensuring optimal performance and stability.

      • data center
  • Blog
  • Dashboard

How to disable ssh access for a user/group but allow command execution

You can restrict users as well as groups to execute all commands over ssh without having access to the server.

  • The first step is to add a new option in /etc/ssh/sshd_config file as follows:
  • For user restriction, add the following and make sure to replace the username with the actual username:

Match User username
PermitTTY no

  • For group restriction, add the following and make sure to replace testgroup with the actual group:

Match Group testgroup
PermitTTY no

  • Reboot the server or restart the service until the new change takes effect.

systemctl restart sshd

Comments

Leave a Reply