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).