Linux - how to disable commands for SSH users - use only Port forwarding / SSH tunnel

Linux - how to disable commands for SSH users - use only Port forwarding / SSH tunnel

Hello,

I only need to allow one user via SSH Port forwarding + SSH tunnel. Is it safe to set up in Linux? I want to prevent him from doing anything else via SSH - entering commands, etc. Thanks

REPLY


Hi,

restrict the permissions of the test2 user to SSH, or forbid him to enter commands can be done as shown below.

Restrict rights - the user cannot enter displays, he will only see the message: "You can use only SSH port forwarding" for 999999999999999 seconds.

vim /etc/ssh/sshd_config

GatewayPorts yes
Match User test2
#AllowTcpForwarding yes
#X11Forwarding no
#PermitTunnel no
#GatewayPorts no
AllowAgentForwarding no
#PermitOpen localhost:62222
ForceCommand echo 'You can use only SSH port forwarding';sleep 999999999999999;


Then reboot or restard sshd ....

Související obsah

linux

bash

terminal

ssh

user

Komentáře

Vaše reakce na Linux - jak zakázat příkazy pro uživatele SSH - použít pouze Port forwarding / SSH tunnel

Reference

Podívejte se na naše reference

Prohlédnout

Aplikace

Podívejte se na naše aplikace

Prohlédnout

Co umíme?

Podívejte se co umíme

Prohlédnout

Co umíme?

Vytváříme sofistikované aplikace pro náročné

Od webových aplikací přes android až po převodové můstky či složité informační systémy.

Podívejte se k nám

Máte ještě čas? Podívejte se na další rubriky

Tento web používá soubory cookie. Dalším procházením tohoto webu vyjadřujete souhlas s jejich používáním.. Více informací zde.