- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: restrict "cd" command from sftp user
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
тАО07-18-2009 10:38 PM
тАО07-18-2009 10:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2009 11:06 PM
тАО07-18-2009 11:06 PM
Re: restrict "cd" command from sftp user
You can do alias for cd in .profile file.
example:-
alias cd=nocd
regards,
Aneesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2009 11:11 PM
тАО07-18-2009 11:11 PM
Re: restrict "cd" command from sftp user
I did try alias, but this done not work if you are using "sftp" to login in.
Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2009 11:18 PM
тАО07-18-2009 11:18 PM
Re: restrict "cd" command from sftp user
Kindly refer this thread,
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1264911
you will get an idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2009 11:19 PM
тАО07-18-2009 11:19 PM
Re: restrict "cd" command from sftp user
Okay , you want to restrict a user from moving around home directory right ?.You can accomplish this by chroot.
Please do the below steps .
1)/opt/ssh/utils/ssh_chroot_setup.sh
2)Provide the username and home directory
3)Select chroot secure shell option as SFTP
Regards,
Aneesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2009 11:29 PM
тАО07-18-2009 11:29 PM
Solutionsftp> GET /etc/passwd
Fetching /etc/passwd to passwd
/etc/passwd 100% 1986 1.9KB/s 00:00
sftp> put badfile /var/tmp
Uploading badfile to /var/tmp/badfile
badfile 100% 66KB 66.3KB/s 00:00
sftp>
Your choices are:
- set file access permissions so that the user cannot read and/or overwrite any unauthorized files (note that there are several essential system files that MUST be readable by every user)
OR
- make sftp-server pretend that there is only the user's directory and essentially nothing else. This is usually implemented with the "chroot" technique.
Please see:
http://docs.hp.com/en/T1471-90033/ch01s12.html
If you have one of the HP-UX SSH versions listed in the document above, please read
/opt/ssh/README.hp on your system. If the chroot technique is suitable to your needs, then use /opt/ssh/utils/ssh_chroot_setup.sh to set it up.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2009 11:36 PM
тАО07-18-2009 11:36 PM
Re: restrict "cd" command from sftp user
two more steps apart from my last post.
4) you may need to do the below changes in /etc/passwd
before:-
test:Z416JPq0mf6zA:103:20:chrooted user:/home/test/:/bin/sh
after:-
test:Z416JPq0mf6zA:103:20:chrooted user:/home/test/./:/bin/sh
5)/sbin/init.d/secsh stop
/sbin/init.d/secsh start
Regards,
Aneesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2009 11:59 PM
тАО07-18-2009 11:59 PM
Re: restrict "cd" command from sftp user
will try chroot, but first I need to upgrade my ssh version.
will let you know the results.
speciall thanks to MK. for rising the version working with chroot.
points will be given once I compete my test.
Regards,
Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2009 12:05 AM
тАО07-19-2009 12:05 AM
Re: restrict "cd" command from sftp user
You can download the latest version of ssh from the below link.
http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA
Regards,
Aneesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2009 03:07 AM
тАО07-19-2009 03:07 AM
Re: restrict "cd" command from sftp user
importent to remember...
1. SSH version must be 5.10.x and above
2. use chroot to create the sftp/scp user
3. change /etc/passwd to include
4. after using chroot,,, remeber to restart ssh
and finally thanks to all who responsd and helped(points been given)
regards,
Ahmed