- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to create restricted sftp account ?
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
Forums
Discussions
Discussions
Discussions
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
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-21-2005 07:02 PM
07-21-2005 07:02 PM
I am able to create a sftp only account by pointing to a self-created shell called /opt/ssh/etc/ftponly. However when I login, the user is able to 'cd' to everywhere. May I know how to restrict it ?
Thanks !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2005 07:34 PM
07-21-2005 07:34 PM
Re: How to create restricted sftp account ?
Have a look at the latest doc related to sftp. Allthough this can be controlled by ftpaccess also if you are using ftpaccess file.
http://docs.hp.com/en/T1471-90013/ch01s02.html
From man ftpaccess :-
============================================
The user's home directory must be properly set up, exactly as anonymous FTP would be. The home directory field of the passwd
entry is divided into two directories. The first field is the root directory which will be the argument to the chroot call.
The second half is the user's home directory relative to the root directory. The two halves are separated by a /./.
Example:
In the /etc/passwd file, the sample entry is:
guest1:
When guest1 successfully logs in, the ftp server will chroot(/ftp) and then chdir (/incoming). The guest user will only be able to access the directory structure under /ftp (which will look and act as / to uest1), just as an anonymous FTP user would.
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 03:20 PM
07-28-2005 03:20 PM
Re: How to create restricted sftp account ?
In /etc/passwd, I have
RMD:Oj9hHfaJL5f8E:116:20:,,,:/proj/is/prod/download/RMD:/opt/ssh/etc/sftponly
Anyone can help me ? Many Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 04:37 PM
07-28-2005 04:37 PM
Re: How to create restricted sftp account ?
Try the following if you use HP Secure Shell
1.configure the user as a chroot user using the /opt/ssh/ssh_chroot_setup.sh script.
2. Edit /etc/passwd file to change the default shell to /opt/ssh/etc/sftponly
This will restrict the user to use only sftp in a chroot-ed directory.
All the best.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 05:58 PM
07-28-2005 05:58 PM
Re: How to create restricted sftp account ?
>sftp RMD@0
Connecting to 0...
Password:
sftp> ls
. ..
sftp> cd ..
sftp> ls
. .. RMD
You can see I can netgivate to upper level. How to fix it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 08:55 PM
07-28-2005 08:55 PM
SolutionYou can note the difference by trying 'ls /' with normal user login and also with 'ls /' with chroot user login.
For information about chroot refer
/opt/ssh/README.hp
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 06:53 PM
07-31-2005 06:53 PM
Re: How to create restricted sftp account ?
Do I really need to upload A.03.91.002 HP-UX Secure Shell ? I tried to copy the lib/gss but still no used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 07:08 PM
07-31-2005 07:08 PM
Re: How to create restricted sftp account ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 07:16 PM
07-31-2005 07:16 PM
Re: How to create restricted sftp account ?
Now, I have 'Connection Closed' if I used /opt/ssh/etc/sftponly (meaning no shell). Or I can jail the user with sftp only, but with shell access if I used /bin/sh. Any one can help ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 09:10 PM
07-31-2005 09:10 PM
Re: How to create restricted sftp account ?
http://www.darklab.net/resources/hpux-mailinglist/3665.html
All The Best
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 02:21 PM
08-02-2005 02:21 PM
Re: How to create restricted sftp account ?
Anyone can help ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 04:51 PM
08-02-2005 04:51 PM
Re: How to create restricted sftp account ?
Have you copied the sftponly.sh to /newroot/bin/ ?. This is required because chroot user can access the "/bin" directory which is under the chroot environment. Try copying the sftpolnly shell to the chroot directory.
All The Best.