Questions tagged [restricted-shell]
The restricted shell is a Unix shell that restricts some of the capabilities available to an interactive user session, or to a shell script, running within it.
28
questions
0
votes
0answers
14 views
Remote access to a Minecraft server over SSH [duplicate]
I have a dedicated server running Ubuntu Server 18.04. I'm going to be hosting a Minecraft server for someone. What's the best way to restrict their read, write, and execute access to only the ...
1
vote
1answer
60 views
How to restrict users so that they can only execute commands from /bin?
I was provided an assignment with several questions. One of the questions is:
How to restrict users can only execute the commands in the directory /bin?
I tried to solve it by using the following ...
0
votes
0answers
41 views
How to limit user to only cat & exit commands? [duplicate]
I would like to limit a user to only two commands: cat and exit.
I've tried to edit visudo but it does not work.
My OS version is CentOSĀ 8.
1
vote
1answer
312 views
How do you install rbash in CentOS 7?
I ran this command:
yum install rbash
And for some reason it told me that the package wasn't available. It didn't come pre-installed on my system either and when I looked it up I was unable to find ...
0
votes
1answer
67 views
Restrict users shell in CentOS-7
I've deployed CentOS-7 login nodes for users, I want restrict them in resources and command level to prevent nasty activities, so far my search only ended up to rbash and lshell and etc..., is there ...
0
votes
1answer
40 views
Giving users Shell access with heavy restrictions
I am developing an in-house file-sharing system like Google Drive/Dropbox with very restricted shell access to users' own folder. The users have to be able to use mv ssh ls cd commands to access and ...
0
votes
0answers
64 views
Why is scp behaving differently via sudo -u for rssh user
I have the following:
Red Hat Enterprise Linux Server release 7.8 (Maipo) called sending_host.
Red Hat Enterprise Linux Server release 6.10 (Santiago) called receiving_host.
A user s_sync_boi which ...
0
votes
0answers
31 views
RSSH - Jail SCP User(s) to only particular directory
I have the two users ferit and scpferit on my Ubuntu server in these groups:
ferit@ubuntuserver:~$ groups ferit
ferit : ferit adm cdrom sudo dip plugdev lxd
ferit@ubuntuserver:~$ groups scpferit
...
0
votes
1answer
24 views
Centos SSH & SFTP user restriction to specific directories
I am managing a server running Cantos 7. Some users login to the server via ssh/sftp for development. For them i have created a user devel. For security reasons, i need to confine them to certain ...
-1
votes
2answers
97 views
Limit User To Run Specific Commands
I have a user test1 that i want to limit it to only run specific commands. I found this solution and I tested it (logged in with test1 and ran some random commands. none of them worked but date) and ...
0
votes
1answer
350 views
AIX restricted shell add entry to inittab
Need a help in adding an entry to the AIX inittab on VIO server. The VIO server is a restricted shell, to add entry to the inittab we need to access the root shell using command: oem_setup_env. I'm ...
4
votes
1answer
510 views
Why does rbash not apply any restrictions for a login shell on Debian 9 (Stretch)?
I am on Debian 9 (Stretch). I have a deploy user where I've set the shell to /bin/rbash. Here is the line from /etc/passwd:
deploy:x:9000:9000::/home/deploy:/bin/rbash
If I am the root user, and I ...
1
vote
1answer
1k views
Restrict SFTP user to run only limited set of commands/action in Linux
How to restrict SFTP users to run only limited set of commands/actions.
For users connected to shell there is a option to configure restricted shell. Once done user can run only allowed commands. e....
0
votes
1answer
2k views
Remote Commands and Restricted Shells via SSH
I'm working on an ssh server where the only thing I ever want the user doing is
ssh user@ip cat somefile
Part of my threat mitigation plan was to give the user restricted bash
I've seen examples ...
0
votes
1answer
283 views
How to create a restricted shell for a specific user
I'm trying to create a restricted shell for a maintenance user.
This user should only be allowed to execute a single bash script within his home folder.
The user should not be allowed to execute any ...
0
votes
0answers
26 views
Allow only rdesktop client on Raspberry Pi
I have an internet connected windows PC thats part of a domain with full controls and restrictions. I have been asked to provide internet connection to another room.
There are quite a few ...
2
votes
1answer
3k views
How can I restrict the normal user to run only limited set of commands in RHEL?
How can I restrict the Normal user to run the only limited set of commands in RHEL?
5
votes
1answer
4k views
Why does “echo os.system('/bin/bash')” work?
I was doing a kind of hacking challenge, a part of which found me stuck inside a restricted shell which had very few commands. One of the available commands was echo. After a few hours of banging my ...
-3
votes
1answer
3k views
Not able to Run cd command with restricted user!
I have restricted a normal user to limited commands using rbash, now am not able to cd (change directory) to other directory,can someone help me how can i run cd command with restricted user, please ...
0
votes
1answer
196 views
Running code when /bin/sh has no rights
I've obtained a shell on an embeded device, a /bin/sh shell, but it is extremely limited; It just allows me to run a few commands with specific arguments, like ifconfig, or iptables, or cat (but not ...
0
votes
1answer
280 views
rbash for ssh ldap users
I have some ssh ldap users who connect to my server (centos7) for reset their password.
I would like they use rbash for execute passwd command but I don't know how to do.
I can't add rbash to /etc/...
1
vote
1answer
1k views
What's the usage of rbash?
I've read some questions about the difference of TTY, console, terminal, etc here and on Askubuntu.
Someone mentioned restricted shell, like rbash or bash -r.
I first fought it is good to give ...
3
votes
2answers
9k views
Make sshd override login shell of a group of users
My users are shared across a number of machines via LDAP.
For one of those machines (let's call it 'fileserf'), I would like to restrict some users in what they can do (actually: prevent them from ...
2
votes
1answer
3k views
NOEXEC and RESTRICT in sudoers
I understand the script below has a serious problem, and NOEXEC and RESTRICT are not enough as a solution to this.
user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf
However, I still have some ...
3
votes
1answer
755 views
Is there an alternative to using rbash to restrict a user on my system?
Basically at the moment I am using rbash to stop a user from leaving his directory on my system. The problem with this is, there is a script in my bin which he needs to be able to run from a script in ...
27
votes
5answers
41k views
Block Particular Command in Linux for Specific user
How to block command, let say mkdir for specific user ?
What I did just created read-only function and store in users profile ~/.bashrc
/bin/mkdir() {
echo "mkdir command not allow for you"
...
6
votes
2answers
10k views
How to discard stderr in restricted Bash shell?
In my .bashrc there are a couple commands which redirect standard error to /dev/null, and this is not allowed within rbash:
bash: /dev/null: restricted: cannot redirect output
Is there some way to ...
2
votes
1answer
6k views
Bash restricted Shell using rbash
I am using /bin/rbash for some users. It's working as expected but there is some hack like when users run bash or dash, then they got unrestricted shells, so to avoid these commands, I have added ...