Hi!
The mkchroot.sh script from rssh-2.3.2 on the current Redhat/Fedora
distributions creates an incomplete environment.
First, it doesn't create /dev/null in the jail.
Second, it misses the /lib/ld-linux* or /lib64/ld-linux* .so.
The symptom of this is that there's a "No such file or directory"
error in the logs:
rssh_chroot_helper[18229]: changing working directory to / (inside jail)
rssh_chroot_helper[18229]: execv() failed,
/usr/libexec/openssh/sftp-server: No such file or directory
The error is quite misleading, since it doesn't mean it cannot find
usr/libexec/openssh/sftp-server (it can), but one of its shared
libraries - in this case it was looking for
lib64/ld-linux-x86-64.so.2.
I'm attaching a patch for mkchroot.sh.
--
Best Regards,
Aleksander Adamowski
http://olo.org.pl
--- mkchroot.sh.orig 2007-10-19 12:31:14.000000000 +0200
+++ mkchroot.sh 2007-10-19 12:33:09.000000000 +0200
@@ -128,7 +128,7 @@
for prog in $scp_path $sftp_server_path $rssh_path $chroot_helper_path; do
echo "Copying libraries for $prog."
- libs=`ldd $prog | tr -s ' ' | cut -d' ' -f3`
+ libs=`ldd $prog | awk '$1 ~ /^\// {print $1} $3 ~ /^\// {print $3}'`
for lib in $libs; do
mkdir -p "$jail_dir$(dirname $lib)"
echo -e "\t$lib"
@@ -170,4 +170,9 @@
echo -e "NOTE: we make no guarantee that ANY of this will work for you... \c"
echo -e "if it\ndoesn't, you're on your own. Sorry!\n"
+#####################################################################
+#
+# set up /dev/null
+#
+cp -a /dev/null "$jail_dir/dev/null"
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
rssh-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rssh-discuss