- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: SFTP and Restricted Shell
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
09-15-2005 05:17 AM
09-15-2005 05:17 AM
SFTP and Restricted Shell
I changed the user to use "rksh" ( or "rsh" ), like this:
transfr:*:153:240:French Translator User,,,:/home/transfr:/usr/bin/rksh
( from "/usr/bin/ksh" to "/usr/bin/rksh" )
But after that, the user can't SFTP anymore:
psftp> open srs010
login as: transfr
Using username "transfr".
Password:
Fatal: unable to initialise SFTP: could not connect
psftp>
However, I don't have problem to login via SSH...
Why I can't SFTP ?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 06:56 AM
09-15-2005 06:56 AM
Re: SFTP and Restricted Shell
Is there any other way I can restrict users to ONLY access their own home directories after they SFTP and SSH to that HP-UX server?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 07:09 AM
09-15-2005 07:09 AM
Re: SFTP and Restricted Shell
If you've done that then the binaries required for certain operations must be in the chroot directory.
More to the point, since ssh works and sftp does not, I suspect its a bug.
What version of ssh/secure shell are you using. If its not current, consider an upgrade. If it is current consider making a bug report.
There is no such thing as perfect software.
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
09-15-2005 07:15 AM
09-15-2005 07:15 AM
Re: SFTP and Restricted Shell
You need to setup restricted shell for that user , with /usr/bin/rsh
You may have a look at this link:
http://newfdawg.com/SHP-RestShell.htm
Cheers ,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 07:17 AM
09-15-2005 07:17 AM
Re: SFTP and Restricted Shell
To restrict users only have access to their own home dir, you can setup with ftponly shell account.
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 07:18 AM
09-15-2005 07:18 AM
Re: SFTP and Restricted Shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 12:52 AM
09-16-2005 12:52 AM
Re: SFTP and Restricted Shell
I think the problem is not the sshd, but the "/usr/bin/rksh" or "/usr/bin/rsh" ( I tried both to replace "/usr/bin/ksh" in /etc/passwd )
When I tried SFTP:
On client side:
psftp> open srs007
login as: transfr
Using username "transfr".
Password:
Fatal: unable to initialise SFTP: could not connect
psftp>
On Server (srs007) side: ( /var/adm/syslog/syslog.log )
Sep 16 08:45:53 srs057 sshd[13357]: Accepted keyboard-interactive/pam for transfr from 10.201.170.151 port 1212 ssh2
Sep 16 08:45:53 srs057 sshd[13403]: subsystem request for sftp
When I tried FTP:
On client side:
User : transfr
530 User transfr access denied...
Login failed.
On Server (srs007) side: ( /var/adm/syslog/syslog.log )
Sep 15 13:07:26 srs057 ftpd[1963]: FTP LOGIN REFUSED (bad shell) FROM 10.201.170.151, transfr
Sep 15 13:07:30 srs057 ftpd[1963]: FTP session closed
I think the restricted shell can't work with SSH well...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 01:15 AM
09-16-2005 01:15 AM
Re: SFTP and Restricted Shell
I did follow that guide several days ago to setup restricted shell, it worked fine for TELNET/SSH, but had problem for FTP/SFTP, I was requested to make both SSH and SFTP working with restricted shell, in order to limit uses to access only their home directory. However, any suggestion to approach such limit without using restricted shell will be fine too...
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 10:33 AM
09-16-2005 10:33 AM
Re: SFTP and Restricted Shell
We have used this often.
Hope this helps.
Best of luck.
Regards,
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 06:22 AM
09-19-2005 06:22 AM
Re: SFTP and Restricted Shell
I wonder in HP environment, can I implement directory restriction on both SFTP and SSH login? That is, can I prevent user from changing directory to the one other than their own, when they login via SFTP and SSH?
I know telnet and ftp, but how about SFTP and SSH?
I need the solution for SFTP and SSH.
I appreciate if someone can help me out. Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2005 12:28 AM
09-21-2005 12:28 AM
Re: SFTP and Restricted Shell
please help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2005 03:19 AM
09-21-2005 03:19 AM
Re: SFTP and Restricted Shell
>Is there any other way I can restrict users to ONLY access their own home directories after they SFTP and SSH to that HP-UX server?
Thanks!
You cannot sftp using rksh, but since you are using ssh that is OpenSSH SSH client (remote login program), there is no point using sftp OR ftp (file transfer program) because using ssh with rksh (and as explained in previous replies how to access home directories only...) you should use scp ONLY and be sure that that account CANNOT use FTP (which he can if the shell figures in /etc/shells)
FTP was designed as FILE TRANFER PROTOCOL not for remote login... and so is used for transfering files from remote server WHERE (normally) the user has no access (other than ftp...)
Do a man of scp...
Using ssh and restricted shell (plus chroot variants..) your account can connect to the remote and is already restricted to his remote home directory now for transfering files all he has to do is use the secure remote copy utility scp and be sure he cannot use ftp (where he is allowed to change directories...)
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2005 05:55 AM
09-21-2005 05:55 AM
Re: SFTP and Restricted Shell
Thanks for your reply!
However, you might haven't got what I was asking, let me explain my current situation again:
In my 2nd post on the top, I have already mentioned "rksh" wouldn't work with SSH/SFTP ( rksh works for TELNET/FTP ), so, let's do not go back to the topic aobut using "rksh", on such server, we ONLY use SSH(running sshd only), no telnet, no ftp.
One of our users called "transfr" wants to use "psftp"(Putty's SFTP client) or "winscp"(GUI SFTP client) to transfer files in between his desktop and the server. So, I can't ask this user to ssh or scp, which you recommended.
Such "transfr" user now can use "psftp" and "winscp" to connect the server and transfer files, but I was asked to limit such user to stay in his own HOME directory, that is, he can't use "cd" to go to his parent directory or any other directories. How can I do it? Could you ( or anyone else ) please give me a DIRECT answer to such topic?
Another thing is that since the user "transfr" have account on the server, he/she can login via SSH ( such SSH I am using here is the term for secure telnet session, I use Putty to ssh to the server ), so, I should block him/her from accessing other directories other than his/her own Home directory, that's why I need such restriction on SSH as well.
That is, I run "sshd" on the server side, want to restrict user "transfr" only access his/her own directory, no matter the user access the directory via SSH or SFTP.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 01:34 AM
09-22-2005 01:34 AM
Re: SFTP and Restricted Shell
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 05:52 AM
09-22-2005 05:52 AM
Re: SFTP and Restricted Shell
For that we need to know what that user needs...
Why does he have access to the server ?(does he run some applications etc...)
You cant have ssh /resctricted shell AND sftp, and ftp bypasses the restricted shell...
So if he only needs to ftp (SFTP or what you want...) you have to create a chroot environment and give /usr/bin/false for shell in /etc/passwd and add /usr/bin/false as a valid shell in /etc/shells...
If he needs a connection to the box (ssh) AND needs to tranfer files from your hp to his pc and vice versa then I would try ssh/rksh combination WITH samba where you would export HIS home directory using samba so he can connect his home directoy as a network share drive under Windows AND not let him use ftp.
I do something similar here where SAS users generate output file as .csv and recuperate their file under I (network drive) using samba no ftp...
IF he doesnt need connection I would remove ssh and use only samba there he can only use and see what you defined...
All the best
Victor