Skip to main content
The 2024 Developer Survey results are live! See the results

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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
171 views

How can I allow scp to a user whose login shell is a restricted shell via rbash

Hi I have a login shell via /bin/rbash However i cannot scp to the home directory. Is there anyway to solve this? scp /tmp/x user@ip:/home/ubuntu/x how to make above work when user always gets a ...
Uise's user avatar
  • 11
1 vote
0 answers
76 views

Block Particular Command in Linux for Specific Users

I want to whitelist some of the commands for users. I am getting solution using LShell Limited Shell but I want to restrict subcommands as well. I want user to access docker ps and docker logs only. ...
mhassaankhokhar's user avatar
0 votes
0 answers
74 views

Restrict user for ssh tunnelling

I'm trying to create a user without shell access just for port forwarding through ssh. The shell of the user is set to /usr/bin/false, but everytime i try to login through ssh it receive Permission ...
deodre's user avatar
  • 1
2 votes
0 answers
124 views

How to re-enable the `enable` command?

As part of a script to set up a restricted user, I ran the enable -n enable command. For testing purposes I would like to undo that command but I can't find any documentation on how to do so. I know ...
ajmeese7's user avatar
  • 244
1 vote
1 answer
2k views

How to restrict a jump user (into openSSH jumpbox) to only SSH to another server?

My Goal: restrict a jump users (into OpenSSH jumpbox) to only SSH to another server. Users should not be able to list directories, cd or anything else except ssh from jumpbox to another server. What I ...
Arnold Jerry's user avatar
-3 votes
2 answers
129 views

Linux Restricted Bash shell perform arithmetic calculations [duplicate]

I have a shell script to calculate cpu and memory resources in a vm. For one task, I would like to perform mathematical calculations in a rbash shell. Could you please guide me the possible ...
satsensort's user avatar
2 votes
1 answer
406 views

Restricted shell rush "invalid uid" error

I am setting up a new local account on a Debian buster server. The account name is "auto-upload". The entry in /etc/passwd looks like this: auto-upload:x:1060:1060:auto-upload:/home/auto-...
rlandster's user avatar
  • 733
2 votes
1 answer
285 views

How can I start a login shell with options?

I am messing around and want to have a guest user whose login shell is a restricted one like rbash. Unfortunately there is no rbash executable anywhere on my Slackware installation, so I have to do ...
Architect's user avatar
  • 173
0 votes
0 answers
17 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 ...
LostXOR's user avatar
  • 225
1 vote
1 answer
443 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 ...
Sangar Tahir's user avatar
0 votes
0 answers
44 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.
kdm.J's user avatar
  • 11
1 vote
1 answer
2k 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 ...
chunchunmaru's user avatar
0 votes
1 answer
337 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 ...
Tux88's user avatar
  • 1
0 votes
1 answer
537 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 ...
user avatar
0 votes
1 answer
177 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 ...
Raja Ayaz's user avatar
-1 votes
2 answers
434 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 ...
BlackCrystal's user avatar
0 votes
1 answer
803 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 ...
satsensort's user avatar
4 votes
1 answer
1k 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 ...
ndbroadbent's user avatar
1 vote
1 answer
4k 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....
Salman Raza's user avatar
0 votes
1 answer
4k 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 ...
notsoslimshady's user avatar
1 vote
1 answer
550 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 ...
user308208's user avatar
0 votes
0 answers
29 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 ...
Fulcrum's user avatar
  • 63
2 votes
1 answer
6k 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?
Manjinder Singh's user avatar
5 votes
1 answer
5k 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 ...
Totem's user avatar
  • 1,111
-4 votes
1 answer
8k 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 ...
vinod M's user avatar
-1 votes
1 answer
318 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 ...
user avatar
0 votes
1 answer
422 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/...
xavierjf's user avatar
1 vote
1 answer
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 ...
Motte001's user avatar
  • 1,220
3 votes
2 answers
11k 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 ...
umläute's user avatar
  • 6,482
2 votes
1 answer
5k 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 ...
mi0pu's user avatar
  • 335
3 votes
1 answer
1k 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 ...
user avatar
28 votes
5 answers
49k 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" ...
Rahul Patil's user avatar
  • 24.9k
9 votes
2 answers
14k 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 ...
l0b0's user avatar
  • 51.9k
2 votes
1 answer
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 ...
Rahul Patil's user avatar
  • 24.9k