vladislav @ dt1: ~ $ getent passwd testuser
testuser: x: 1002: 1003: ,,,: / home / testuser: / usr / bin / lshell
vladislav @ dt1: ~ $ su - testuser
Password:
You are in a limited shell.
Type '?' or 'help' to get the list of allowed commands
testuser: ~ $?
cd clear echo exit help history ll lpath ls lsudo
testuser: ~ $ ls
examples.desktop
testuser: ~ $ which bash
*** forbidden command: which
testuser: ~ $ ls'usb '
Bus 002 Device 001: ID 1d6b: 0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 046d: c05a Logitech, Inc. M90 / M100 Optical Mouse
Bus 001 Device 002: ID 046d: c31c Logitech, Inc. Keyboard K120
Bus 001 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 root hub
testuser: ~ $ echo && 'bash'
testuser @ dt1: ~ $ PATH = / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / usr / games: / usr / local / games: / snap / bin
testuser @ dt1: ~ $ reboot --help
reboot [OPTIONS ...] [ARG]
Reboot the system.
--help Show this help
--halt Halt the machine
-p --poweroff Switch off the machine
--reboot Reboot the machine
-f --force Force immediate halt / power-off / reboot
-w --wtmp-only Don't halt / power-off / reboot, just write wtmp record
-d --no-wtmp Don't write wtmp record
halt / power-off / reboot
vladislav @ dt1: ~ $ su - testuser Password: You are in a limited shell. Type '?' or 'help' to get the list of allowed commands testuser: ~ $? cd clear echo exit help history ll lpath ls lsudo testuser: ~ $ echo '/ 1.sh' testuser @ dt1: ~ $ cat echo / 1.sh #! / bin / bash / bin / bash testuser @ dt1: ~ $
vladislav @ dt1: ~ $ getent passwd testuser testuser: x: 1001: 1002: ,,,: / home / testuser: / usr / bin / lshell vladislav @ dt1: ~ $ su - testuser Password: You are in a limited shell. Type '?' or 'help' to get the list of allowed commands testuser: ~ $? cd clear echo exit help history ll lpath ls lsudo testuser: ~ $ bash *** forbidden command: bash testuser: ~ $ echo <CTRL + V> <CTRL + J> bash testuser @ dt1: ~ $ which bash / bin / bash
Source: https://habr.com/ru/post/308028/
All Articles