OpenSolaris

Printable Version Enter a New Search
Bug ID 5043377
Synopsis provide chroot capability in SunSSH
State 10-Fix Delivered (Fix available in build)
Category:Subcategory ssh:interop
Keywords amber_road | gse-sec-team
Responsible Engineer Jan Pechanec
Reported Against 2.9 , s10 , 5.10 , s10_51 , s10_58 , s10_67 , s10u3_10 , solaris_10
Duplicate Of
Introduced In
Commit to Fix snv_112
Fixed In snv_112
Release Fixed solaris_nevada(snv_112)
Related Bugs 5003459 , 6736043 , 6807195 , 6809398 , 6809401 , 6809406 , 6813038 , 6820855 , 5062827
Submit Date 6-May-2004
Last Update Date 8-April-2009
Description
Would like chroot capability with Solaris 9 provided sftp as found in OpenSSH/SFTP. This is needed for a more secure transfer of data to a server over the internet and to safeguard the data on the destination system.
One option would be to implement the same functionality as already found in login(1) in ssh:

     If  the  login-shell  field  in  the  password   file   (see
     passwd(4))  is  empty, then the default command interpreter,
     /usr/bin/sh, is used. If this field is  *  (asterisk),  then
     the  named  directory  becomes  the  root directory. At that
     point, login is re-executed at the  new  level,  which  must
     have its own root structure.

Secondly, http://chrootssh.sourceforge.net/ does the same sort of thing, but instead is triggered by putting a /./ in the homedir entry in the passwd file, which might cause other applications problems.
Work Around
 xxxxx@xxxxx.com 2004-05-06

Use the freely available pam_chroot module, or put a chroot wrapper around
sftp-server.
Comments
OpenSSH added chroot option in the meantime, see its sshd_config man page. We could resync that.

     ChrootDirectory
             Specifies a path to chroot(2) to after authentication.  This
             path, and all its components, must be root-owned directories that
             are not writable by any other user or group.

             The path may contain the following tokens that are expanded at
             runtime once the connecting user has been authenticated: %% is
             replaced by a literal '%', %h is replaced by the home directory
             of the user being authenticated, and %u is replaced by the user-
             name of that user.

             The ChrootDirectory must contain the necessary files and directo-
             ries to support the users' session.  For an interactive session
             this requires at least a shell, typically sh(1), and basic /dev
             nodes such as null(4), zero(4), stdin(4), stdout(4), stderr(4),
             arandom(4) and tty(4) devices.  For file transfer sessions using
             ``sftp'', no additional configuration of the environment is nec-
             essary if the in-process sftp server is used (see Subsystem for
             details).

             The default is not to chroot(2).