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
0 votes
0 answers
47 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
89 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
  • 215
0 votes
1 answer
1k 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
109 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
323 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
213 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
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 ...
LostXOR's user avatar
  • 213
1 vote
1 answer
279 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
1k 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
271 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
322 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
140 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
300 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
698 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
421 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
28 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
5k 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,091
-4 votes
1 answer
7k 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
308 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
409 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,210
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,352
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
47k 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.3k
9 votes
2 answers
13k 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
  • 50.7k
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.3k