Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I tried a few different ways to chroot a user, but the user can still browse around.
The user created: guests:guests
The entry in passwd:
guests:x:128:102:GuestFTP:/dir/./guests/:/usr/lib/ssh/sftp-server
done ftpconfig -d /dir/guests
created /etc/shells and /bin/true added
/etc/ftpd/ftpaccess modified to include:
guestuser guests
upload /dir/guests/pub * no
upload /dir/guests/pub /pub yes guests guests 0666 nodirs
upload /dir/guests/pub /pub yes guests guests 0666 nodirs
In this way the user guests can still browse the directories and is not jailed to his dir. When I replaced the shell to /bin/true, the sftp closes straight after authentication with exit status 0. I also tried /usr/bin/true (was added to /etc/shells), but exit status 0 again.
The other way I tried:
added to the /etc/ssh/sshd_config
Subsystem sftp /usr/lib/ssh/sftp-server
Match Group guests
ChrootDirectory /dir/guests
ForceCommand /usr/lib/ssh/sftp-server
AllowTcpForwarding no
Then restarted the ssh, but ssh went into maintenance and reported Bad configuration option Match, the same for ChrootDirectory and ForceCommand.
I thought Match was valid for OpenSSH_5.
I have ran out of options. I would really appreciate any help and comments. Thanks a lot.
That's a big issue with Sol 10 (At least, it seems as though it all used to be so much easier
Rather than going the full-chroot avenue (where you have to copy all the relevant binary and libraries into the chrooted environment - so your user can do "ls", etc), check out this page. I've found it to be very helpful:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.