restricting access...

Thread Tools Search this Thread
Special Forums Cybersecurity restricting access...
# 1  
Old 05-07-2001
restricted access...
I need to restrict users shell access to only $HOME under /home for each user. I don't want them getting out of their own directories. From what I understand chroot is something I could use, but I want to avoid this since it involves creating symbolic links to a number of places and I'm not sure what would be involved to link mySQL and web server things since these users virtually host websites on this machine. I was thinking more of something in their profiles, .rbash ? How do I use this on Linux, Red Hat?

Many thanks for any help.


p.s. apologies I had posted this in a wholly innappropriate place previously Smilie
# 2  
Old 05-07-2001
It is difficult to do this without using chroot. You might want to investigate using rsh (restricted shell) as their login shell.

Alternately, you could write your own shell or hack one to remove/alter "cd". A resourceful user could always find ways around that though.
# 3  
Old 05-08-2001

Thanks PxT, I am going to consider that for users who need a command prompt, I wonder if you could help me I've been working on this all night with no luck...

I want to chroot ftp users to their home dir, I have set up /etc and /bin in their directories, modified the /etc/passwd to:


So they should chroot to /home and then chdir to their directory, and sit in that jail and not be allowed out of /home. I created passwd and group in ~etc.

The final bit of the plot was to add the guest ftp entry into /etc/ftpaccess. Which I did as:

guestgroup group

Where group is the group of the user.

However when I attempt to login as that user it says invalid username or password, if I take out this entry from ftpaccess I can login and am taken to /home/user, but I can escape from /home which I would expect as it clearly hasnt been specified as a chrooted guest ftp account, its only taking the directory to land me in from /etc/passwd.

Do you know what the problem could be? I've tried changing owners, permissions, messing around with ftpaccess, nothing seems to work.

Thanks for any help, from anyone.

# 4  
Old 05-09-2001

I have sorted out ftpaccess and chroot works - but I cant see any files or dirs when I ftp in as a chrooted guest ftp user. I have copied /bin/ls to ~bin/ls, still the same. I guess I need to move the libraries into place in ~lib ? And then link them correctly - I can use the ldd to isolate the libraries but I think there is more to it than this, does anyone know how I would set up the libraries so that ls works? Im using Red Hat.

Thanks anyone.

# 5  
Old 05-09-2001
Can you post your login scripts that call the chroot command and the login command you are using in the /etc/passwd file?

Let's work this openly with all files/details so those who follow will benefit from the trail blazed in this thread. Thanks!
# 6  
Old 05-09-2001
When dealing with ftp, there are no login scripts involved. the ftp daemon itself calls the chroot command. You need to set up the home directories carefully. Full instructions are in the man page for ftpd:

And more details on the 'guestgroup' configuration are in:
# 7  
Old 05-09-2001
3 possibilities:
chroot directory given in your /etc/passwd file for the guest account must be to the directory where your ~/bin directory is located. That is, if your chroot directory is /home/user/ and your /etc/passwd account is:


it will not work, as the ~/bin directory is not under the chrooted directory. It must be set as follows.


find "ls" source somewhere (for example, GNU fileutils source package from ), and compile it statically under your chroot'ed environment.

The other option is, as you mentioned find out what libraries ls wants, and make copies of them in ~lib under your chroot'ed environment.

As Neo said please post you configuration stuff so that others may benefit from it!


[Edited by mib on 05-09-2001 at 03:38 PM]
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Restricting commands & access

Dear all, I am administering a DC environment of over 100+ Solaris servers used by various teams including Databases. Every user created on the node belonging to databases is assigned group staff(10) . I want that all users belonging to staff should NOT be able to execute certain system... (6 Replies)
Discussion started by: Junaid Subhani
6 Replies

2. UNIX for Dummies Questions & Answers

Restricting SFTP access

Hello, I am using MySecureShell to chroot all sftp accesses. The problem that I have is that my boss does not want root to be able to use sftp. Root should still be able to ssh. Any ideas? (2 Replies)
Discussion started by: mojoman
2 Replies

3. Solaris

Restricting CPU Core Access

Hi all. I've had a quick look around but cant see anything exactly matching my requirements. I have a new T2000 running S10. Im looking to restrict the no. cores that a S10 non-global zone can use to 1 only. The box is single CPU but 8core. I want to do this to save on some software... (4 Replies)
Discussion started by: boneyard
4 Replies

4. Solaris

Restricting FTP access for a particular directory

Dear All, I have created a user called "x" who is allowed only to FTP and it is working fine. Here my problem is, I want to give access to a particular directory say for eg:- /dump/test directory. I don't find any option in the useradd command to restrict access to this particular directory only... (1 Reply)
Discussion started by: Vijayakumarpc
1 Replies

5. UNIX for Advanced & Expert Users

Restricting access to code

Hi All, I am facing a problem, regarding code security on a server. We have configured a server which contains our code (ear present in jboss/server/xyz/deploy) in it, and need to bind the code to the server itself so that no one can take the code out of the. the problem is that the password of... (3 Replies)
Discussion started by: akshay61286
3 Replies

6. Solaris

restricting access to a server

We want to secure access to a server by restricting the number of users who can login to it. Our users are NIS users. Only few of them can telnet/ssh this server. Do you have any idea on how to implement that? thanks. (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

7. UNIX for Advanced & Expert Users

restricting root access

I'm the admin in a shop in which my developers have and use the root account, all UNIX newbies. I've been unable to convince management myself that this is an unacceptable practice. I've looked in a couple books I have and can't find any chapters, discussions, etc that make the argument that... (2 Replies)
Discussion started by: keith.m
2 Replies

8. Solaris

restricting access

Hi All, I'm on Solaris 8, I need to provide Read-only access to a user to 2 directories only. Using rsh (restricted shell) as the user's login shell, I can restrict the user's access to a certain directory only, but how can I set in such a way that the user can access only the 2 directories... (4 Replies)
Discussion started by: max_min
4 Replies

9. UNIX for Dummies Questions & Answers

Restricting access to a machine by IP Address

I have a need to allow only certain IP addresses to access a machine running solaris 9. I am not sure how this can be accomplished. Thanks in advance for your help. Patch (2 Replies)
Discussion started by: patch
2 Replies

10. UNIX for Dummies Questions & Answers

Restricting access

I need to create a user that only has access to 1 directory (e.g. /vol/mita/test). The user needs to be able to rsh into that directory to run a script. The user should not be able to navigate to any other directories above /vol/mita/test. Any help would be appreciated! (4 Replies)
Discussion started by: ngagne
4 Replies
Login or Register to Ask a Question