Sponsored Content
Operating Systems Linux Red Hat restrict access of a user to two directories only Post 302185690 by vikas027 on Tuesday 15th of April 2008 02:08:37 PM
Old 04-15-2008
Hi all,
Now i got some success in achieving jail.

I have used the above mentioned script fuschlberger.net - Howto Setup a chroot-jail for ssh/scp with Linux and ran it as

Code:

Quote:
./make_chroot_jail.sh jdoe /bin/bash /home/jail/./home/jdoe
Now, I need to give full access to other two directories to jdoe, say /tmp1 and /tmp2 which at present I cannot access when I login as ssh jdoe@localhost.

Here, I am pasting my variables.

Code:
bash-3.1$ set
BASH=/bin/sh
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="1" [2]="17" [3]="1" [4]="release" [5]="i686-redhat-linux-gnu")
BASH_VERSION='3.1.17(1)-release'
COLUMNS=157
DIRSTACK=()
EUID=501
GROUPS=()
HISTFILE=/home/jdoe/home/jdoe/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/home/jdoe/home/jdoe
HOSTNAME=RHEL
HOSTTYPE=i686
IFS=$' \t\n'
LD_LIBRARY_PATH=/usr/kerberos/lib
LINES=52
LOGNAME=jdoe
MACHTYPE=i686-redhat-linux-gnu
MAIL=/var/mail/jdoe
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/home/jdoe/home/jdoe/bin
PIPESTATUS=([0]="0")
PPID=18143
PS1='\s-\v\$ '
PS2='> '
PS4='+ '
PWD=/home/jdoe/home/jdoe
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
SSH_CLIENT='127.0.0.1 43358 22'
SSH_CONNECTION='127.0.0.1 43358 127.0.0.1 22'
SSH_TTY=/dev/pts/0
TERM=xterm
UID=501
USER=jdoe
_=set
-bash-3.1$


How, can I modify the script (or some other way) to achieve this ????

Pls help.

Thanks.

Last edited by vikas027; 04-16-2008 at 12:46 AM.. Reason: wrong url by mistake
 

10 More Discussions You Might Find Interesting

1. HP-UX

How to restrict a user group to access the kernel

Hi, Please any one can help me to know that how we can restrict a user group to access the kernel at all. (0 Replies)
Discussion started by: harishankar
0 Replies

2. UNIX for Advanced & Expert Users

Restrict FTP access to a single directory for only one user.

Hi All, It will be very great if you can help me in this issue. Thanks in advance. I need to enable FTP on a solaris9 server. I need to create a new user some "xxxxxx" and he can only FTP the files to and from between /tftpboot directory and network devices. Other users should not... (8 Replies)
Discussion started by: santhoshkumar_d
8 Replies

3. UNIX for Dummies Questions & Answers

Restrict user access to their home dir

Hi! i'm using FreeBSD 6.2 and hosting my pc to frens in particular of sensitive information being saved to the PC, i would like to know is it possible for me to restrict user access to their /home dir. only? and also, i wanted to restrict them listing files under /etc thanks all! (10 Replies)
Discussion started by: rdns
10 Replies

4. UNIX for Advanced & Expert Users

Restrict Access to the folder

Hi I have requirement to create 3 new users on my server but to restrict their access to a set of particular folders. /export/home/kapil/shared, /export/home/kapil/shared/Folder1 /export/home/kapil/shared/Folder2 These folders should be accessible to all the 3 users and to me too.... (1 Reply)
Discussion started by: kapilk
1 Replies

5. UNIX for Dummies Questions & Answers

Restrict user access.

Hi All, How can we restrict a particular user access to a particular shell in solaris 10. Thanks in Advance. (5 Replies)
Discussion started by: rama krishna
5 Replies

6. Red Hat

Restrict user access

Hi there I have an application user on my system that wants accesses to these file systems as such: rwx: /SAPO /SAPS12 /R3_888 /R3_888B /R3_888F /R3_888R r: /usr/sap these are the existing FS permissions:ownerships: # ls -ld /SAPO (9 Replies)
Discussion started by: hedkandi
9 Replies

7. UNIX for Dummies Questions & Answers

Rsync on Cygwin - Restrict user to several directories

Hi, I'm using rsync on cygwin (winXP) to sync our files between several laptops and XP (acting as a file server) For simplicity I use the same user account with different certificates over SSH. Now my question is; If a user understands the logic and modifies the rsync command, he can easily... (0 Replies)
Discussion started by: cemo
0 Replies

8. Shell Programming and Scripting

Allow FTP user to access multiple directories

Hi Experts, I am in urgent need of your suggestions. I have below two users in my system: xyz:x:101:101:XYZ System Account:/export/home/xyz:/bin/bash abc:x:2009:10:ftp user only:/export/home/abc:/bin/false Where "xyz" is the crucial one and "abc" is only introduced for FTPing the... (2 Replies)
Discussion started by: sugarcane
2 Replies

9. UNIX for Dummies Questions & Answers

Restrict access

I'm trying to use squid to restrict elinks' access to certain websites(only http traffic). I have tried some configs in squid.conf but no luck. Hope someone has a bit of time to explain me how can you make these config's :) ---------- Post updated at 05:40 PM ---------- Previous update was at... (1 Reply)
Discussion started by: Birnbacher
1 Replies

10. Shell Programming and Scripting

Generate list of directories that a user has access to

I manage an AIX OS 7.1 system on IBM Power 770. I want to find out which directories/folders a particular user has read/write access to. How can I cleanly create a list of all directories on the system that a user has access to.. Does this make sense? Thanks in Advance, NEWB:rolleyes: (3 Replies)
Discussion started by: code911
3 Replies
createhomedir(1)					    BSD General Commands Manual 					  createhomedir(1)

NAME
createhomedir -- create and populate home directories on the local computer. SYNOPSIS
createhomedir [-scbalh] [-n directoryDomainName] [-u username] DESCRIPTION
createhomedir provides several options for creating and populating home directories. OPTIONS
-s creates home directories for server home paths only (default). -c creates home directories for local home paths only. -b creates home directories for both server and local home paths. -a creates home directories for users defined in all directory domains of the server's search path. -l creates home directories for users defined in the local directory domain. -L causes the created home directory to be localized. -n directoryDomainName creates home directories for users defined in a specific directory domain in the server's search path. -u username creates a home directory for a specific user defined in the domain(s) identified in the -a, -l, or -n parameter. If you omit the -a, -l, and -n parameters when you use the -u parameter, -a is assumed. -i reads username list from standard input and creates specified home directories. Each username should be on its own line. -h usage help. FILES
/usr/sbin/createhomedir location of tool CAVEATS
When using the -a option, search limits of various directory servers (such as Open Directory or Active Directory) can prevent all possible home directories from being created. In this case, you may need to specify the usernames explicitly. Mac OS X May 31, 2019 Mac OS X
All times are GMT -4. The time now is 01:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy