- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sshd and chroot
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2009 12:55 AM
тАО05-20-2009 12:55 AM
sshd and chroot
i try to get chroot with HP-UX sec shell 05.10 to work.
I use the script ssh_chroot_setup.sh.
When i try to connect, i am still in "normal" userhome.
So i make changes in sshd_config:
Match User test03
ChrootDirectory /newroot/home/test03
like discripe here:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1262739
But now, i can not connect:
Connection to "IP address" closed by remote host.
Couldn't read packet: Connection reset by peer
Syslog:
fatal: bad ownership or modes for chroot directory
who can help?
Ralph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2009 01:00 AM
тАО05-20-2009 01:00 AM
Re: sshd and chroot
user's home directories must be owned by root:root and its mode should be 755
thanks
Kamal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2009 01:10 AM
тАО05-20-2009 01:10 AM
Re: sshd and chroot
This message is spot on accurate.
fatal: bad ownership or modes for chroot directory
The most common problem I had when chrooting any ssh installation was the ownership and permissions were wrong.
Please post the ownership of the users home directory.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2009 01:33 AM
тАО05-20-2009 01:33 AM
Re: sshd and chroot
theese permission are set by the script:
# ll -a /newroot/home/
total 16
drwxr-xr-x 3 root root 96 May 20 10:32 .
drwxr-xr-x 10 root root 8192 May 20 10:32 ..
drwxr-xr-x 2 test03 users 96 May 20 10:32 test03
I do not change anything.
Ralph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2009 01:59 AM
тАО05-20-2009 01:59 AM
Re: sshd and chroot
i change permissions to root:root.
Now i get with sftp :Request for subsystem 'sftp' failed on channel 0
i check libs with #ldd /opt/ssh/libexec/sftp-server (see /opt/ssh/README.hp)
-- > Looks good!
With ssh i get /bin/sh no such file...
but there is a /newroot/bin/sh
Ralph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2009 04:22 AM
тАО05-20-2009 04:22 AM
Re: sshd and chroot
i think you are using a new version of openssh which doesn't require to create mini-operating system as your script did.
that means. just create an empty home directory for your user
for example
useradd -d test test
mkdir /home/test
chown root:root /home/test
chmod 766 /home/test
then edit sshd_config with
Match User test
ChrootDirectory /home/test
check also if these options are available with your ssh version
Match User test
AllowTcpForwarding no
ForceCommand internal-sftp
ChrootDirectory /home/test
Note: for more than one user e.g test,test1,test2 use the following
Match User test,test1,test2
AllowTcpForwarding no
ForceCommand internal-sftp
ChrootDirectory /home/%u
where %u is taking the list of users u specified in Match User directive.
thanks :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2009 04:46 AM
тАО05-20-2009 04:46 AM
Re: sshd and chroot
if i try it like this i get /sbin/sh not such file...
So i think i need a mini system, like discriped in /opt/ssh/README.hp.
Are you sure with chmod 766, only 755 works for me?
Ralph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2009 09:18 PM
тАО05-20-2009 09:18 PM
Re: sshd and chroot
permission should be 755
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2009 07:36 AM
тАО05-27-2009 07:36 AM
Re: sshd and chroot
now it works...
I use the script ssh_chroot_setup.sh.
I make changes in sshd_config:
Match User test03
ChrootDirectory /newroot
For ChrootDirectory i use the dir i choose for
my chroot environment, not a home dir!
i am not using internal-sftp.
With that the connection closed after ls command!
Thanks
Ralph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2009 11:36 PM
тАО05-27-2009 11:36 PM