Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Help with Openssh V5 - SFTP Chroot issue |
|---|---|
| Date: | Thu, 10 Jul 2008 16:08:14 -0400 |
All, since I have had no luck with RSSH on Solaris 10, I
went ahead and built OpenSSH_5.0p1, OpenSSL 0.9.7d 17 Mar 2004 (+
security patches to 2006-09-29), however, after making the necessary
recommendation to get it work or shall I say accept a "sftp connection"
I still cannot "put" files. Here is what is interesting:
My jailed directory is /sftp and it must be owned by root:root with
perms 755
The user must be marked as /bin/false in the /etc/passwd
My jailed user directory specified in the sshd_config as shown below is
/sftp/username, in my case citicorr, also note the group name citicorr
in the cp of the sshd_config below. Here's the catch you must change
the sftp user account to also be owned by root:root. So, even though I
can connect via sftp as user citicorr who is in a group citicorr, the
user cannot put since the dir is owned by root:root. If I change
ownership of the /sftp/citicorr directory to citicorr:root or
citicorr:citicorr the user cannot even connect and it displays a error
in the /var/adm/messages Jul 9 22:28:16 mdsuawa0p sshd[18006]: [ID
800047 auth.crit] fatal: bad ownership or modes for chroot directory
"/sftp/citicorr". ANY HELP WOULD BE APPRECIATED!!!!
Password File Entry -
citicorr:x:502:303:citicorr:/sftp/citicorr:/bin/false
Group File Entry citicorr::303:Subsystem sftp internal-sftp
Jail Dir - drwxr-xr-x 5 root root 512 Jul 9 23:13 sftp
SFTP Home dir - /sftp/citicorr drwxr-xr-x 2 root citicorr 512
Jul 9 22:18 citicorr
Sshd_config Entry
Match group citicorr
ChrootDirectory %h
AllowTcpForwarding no
ForceCommand internal-sftp
[@msuals01]$ sftp -o port=1022 citicorr@mdsuawa0p
Connecting to mdsuawa0p...
Warning: Permanently added 'mdsuawa0p,172.25.17.197' (RSA) to the list
of known hosts.
citicorr@mdsuawa0p's password:
sftp> pwd
Remote working directory: /
sftp> ls
sftp> put roland
Uploading roland to /roland
Couldn't get handle: Permission denied
sftp>
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: On why debugging OpenSSH can be so hard, Derek Martin |
|---|---|
| Next by Date: | RE: Deliberately create slow SSH response?, Fromm, Stephen (NIH/NIMH) [C] |
| Previous by Thread: | problems with ChrootDirectory, Joseph Spenner |
| Next by Thread: | openssh v5.0p1 chroot/sftp mac os x 10.4 errors, Luke Brannon |
| Indexes: | [Date] [Thread] [Top] [All Lists] |