Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

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.

0
votes
1answer
46 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
161 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
20 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 ...
1
vote
1answer
946 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
2k 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
1k 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
97 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
201 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
799 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 ...
2
votes
2answers
5k 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
542 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 ...
26
votes
5answers
33k 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
7k 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
5k 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 ...