LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-15-2009, 07:03 AM   #1
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Rep: Reputation: 15
Bash exec: 63: id: not found when users log in into jail


I'm administering a student server where students get login through Ssh into their own folder.

The students are jailed in a directory resembling a filesystem on it's own with only strictly checked commands to be executed as a security precaution.

Everything works except for a minor inconvenience: when jailed students log in they first get a:

Quote:
Command 'groups'
failed with return code 2 and error message
exec: 63: id: not found.
After that, they get a normal prompt and everything works alright.
I obviously want to get rid of that annoying error message, but don't know what triggers that.

The group file is present in /etc together with the passwd file.
 
Old 08-15-2009, 07:31 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Find the difference by executing 'locate id' inside and outside the chroot?
 
Old 08-15-2009, 07:44 AM   #3
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Original Poster
Rep: Reputation: 15
Outside the jail, "locate id" showed a huge list with every file owned by all users (mostly accounts in the jail), while executing that command within the jail reveals that the command "locate" isn't present in the jail.

I'll make that command available in the jail and see if that solves it.

*edit*
nope doesn't fix the problem

Last edited by Carroarmato0; 08-15-2009 at 07:48 AM. Reason: update
 
Old 08-15-2009, 08:29 AM   #4
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Original Poster
Rep: Reputation: 15
I did some searching at what "groups" actually does, it gives a list of all the groups a user is present. It might be that it doesn't like something in there. Going to check it out.
 
Old 08-16-2009, 05:06 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Carroarmato0 View Post
Outside the jail, "locate id" showed a huge list with every file owned by all users (mostly accounts in the jail), while executing that command within the jail reveals that the command "locate" isn't present in the jail.
Sorry, should have been 'which id', meaning that if (/usr/bin/)id isn't available any commands relying on it will fail.


Quote:
Originally Posted by Carroarmato0 View Post
I'll make that command available in the jail and see if that solves it.
You should be careful what you make available inside your chroot wrt potential security risks. Besides drawing in more binaries may result in needing more supporting libraries as well. If you want a set of binaries rolled into one check out Busybox.


Quote:
Originally Posted by Carroarmato0 View Post
I did some searching at what "groups" actually does, it gives a list of all the groups a user is present. It might be that it doesn't like something in there.
The shell system-wide resource files in (/path/to/chroot)/etc.
 
Old 08-16-2009, 05:28 AM   #6
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Original Poster
Rep: Reputation: 15
"Which id" outside the jail returns /usr/bin/id

and inside the jail "which" isn't even present. So I guess that "id" is infact a command rather something strange in some configuration file, that resolves some confusion since I was looking for a wrong problem.
 
Old 08-16-2009, 05:32 AM   #7
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
Sorry, should have been 'which id', meaning that if (/usr/bin/)id isn't available any commands relying on it will fail.



You should be careful what you make available inside your chroot wrt potential security risks. Besides drawing in more binaries may result in needing more supporting libraries as well. If you want a set of binaries rolled into one check out Busybox.



The shell system-wide resource files in (/path/to/chroot)/etc.

Thank you so very much, it was in fact the absence of the "id" command in the jail that returns the error. It was kind of a confusing error since I was looking for some identity error rathen than a missing command.

But I'm very grateful and so will new students too who would otherwise be a little scared from the error message alway poping up.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Chroot: how to Qmail found with PHP/Apache in Jail? linuxy Linux - Server 0 03-17-2008 06:54 AM
chroot jail with rssh / restricting users to individual directories rob_xx17 Linux - Security 3 01-23-2006 03:28 AM
exec bash command bendeco13 Linux - General 6 10-31-2004 03:50 PM
Jail Root FTP Users linuxboy69 Linux - Newbie 1 02-26-2004 02:22 PM
chroot jail sftp users f1uke Linux - Security 1 07-28-2003 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration