View previous topic :: View next topic |
Author |
Message |
Matrixmonkey n00b
Joined: 18 Apr 2003 Posts: 43 Location: Bradford,UK
|
Posted: Sun Aug 22, 2004 11:21 am Post subject: secure ftp? for select number of users |
|
|
i need to set up a ftp server but only ftp NO shell access
to there home dir (well it was in www dir but moved it now )
ive been looking up proftpd+msql but no joy
and thought about adding users with the option -s /bin/false
but that would still leave passwords on the system
so any idea's would leave me for ever in your debt
Matrixmonkey |
|
Back to top |
|
|
bunsen Tux's lil' helper
Joined: 10 Aug 2003 Posts: 105
|
Posted: Sun Aug 22, 2004 11:30 am Post subject: |
|
|
openssh ships with sftp. I've not used it, so can't say whether it's of any use to you. |
|
Back to top |
|
|
Matrixmonkey n00b
Joined: 18 Apr 2003 Posts: 43 Location: Bradford,UK
|
Posted: Sun Aug 22, 2004 2:59 pm Post subject: |
|
|
ahhh forgot to say the users are windows users and thick ones at that so would need a windows client
keep trying to turn them to the light side of the force but no joy
the dark side is stronger _________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.dicknlyd.co.uk |
|
Back to top |
|
|
jonnymalm n00b
Joined: 26 Jun 2002 Posts: 68
|
Posted: Sun Aug 22, 2004 3:29 pm Post subject: |
|
|
sftp that ships with openssh is the way to go.
There is a great windows client called WinSCP that is easy to use for all of your thick windows users. it is opensource/freeware and you can get it at http://winscp.sourceforge.net/eng/
I have never setup openssh without ssh shell access but I am sure that you can do it. |
|
Back to top |
|
|
echo6 Guru
Joined: 04 Jan 2003 Posts: 587
|
Posted: Sat Sep 04, 2004 1:30 pm Post subject: |
|
|
So what is the answer?
How do you allow an account for sftp access and disable ssh access? |
|
Back to top |
|
|
petterg Guru
Joined: 25 Mar 2004 Posts: 500 Location: Oslo, Norway
|
Posted: Sat Sep 04, 2004 2:08 pm Post subject: |
|
|
You're not telling why you want this, but I'm guessing you want users to only have access to /home and subdirs of /home.
(Block access to all other files in the system.)
If my guessing is correct, openssh 3.7.1_p2-r2 with chroot patch is the way to go. (I've had no success on making the chroot patch work with 3.8.* and 3.9.*!)
This will not stop users from having shell access, but it will stop them from having access to other files. You are also controlling what binarys they are allowed to run. To make sftp work they need access to ls, cp, mv, rm, mkdir, rmdir and bash.
The downside of this is that users will still be able to create ssh tunels to the server, so if your goal is to protect other computers on the local network this will be the wrong way to go. (Unless there are some way to block tunnelling that I'm not aware of.)
Regarding windows client: Check out Filezilla. |
|
Back to top |
|
|
echo6 Guru
Joined: 04 Jan 2003 Posts: 587
|
Posted: Sat Sep 04, 2004 2:16 pm Post subject: |
|
|
I simply want users to be able to use WinSCP to upload/download files etc, but I don't want them to have access to a shell on the server.
I was looking for a simple solution to just possibly allow access to those commands required for ftp without users having access to the other commands.
Oh well, now looking at grsecurity and access control lists as a possible way to go, I guess there's no simple solution. I already have the gentoo-hardened kernel compiled and the server is up and running may as well go for it |
|
Back to top |
|
|
hanj Veteran
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Sat Sep 04, 2004 4:13 pm Post subject: |
|
|
If sFTP isn't an option for you.. I would recommend vsftp for an FTP server.
As to your other question.. you can set up users without a shell...
Code: | useradd -s /bin/false -m -g usergroup username |
I would also add another layer if possible restricting access to port 21 from 'trusted networks' via iptables. Since you have small amount of users connecting.. you can limit it only to those IPs. I understand that they may be coming from large networks/DHCP.. and don't have a static, but you could open it to the netblock. This is still restricting it considerably. It all depends on how many users are using DHCP vs Static. If the majority is static.. then I would say it is worth it.
hope this helps
hanji |
|
Back to top |
|
|
echo6 Guru
Joined: 04 Jan 2003 Posts: 587
|
Posted: Sat Sep 04, 2004 4:49 pm Post subject: |
|
|
Majority of access will be from unknown IP addresses, so using hosts.allow or configured iptable is not an option.
I currently have vsftpd but was hoping to use the added security of ssh. Setting up users without a shell disables sftp/scp access
Oh! another thing to remember when using /bin/false it requires an entry in /etc/shells for this to work with vsftp. |
|
Back to top |
|
|
hanj Veteran
Joined: 19 Aug 2003 Posts: 1500
|
|
Back to top |
|
|
petterg Guru
Joined: 25 Mar 2004 Posts: 500 Location: Oslo, Norway
|
Posted: Sat Sep 04, 2004 5:13 pm Post subject: |
|
|
I figured out how to make the chroot patch work with openssh-3.9. It need some more files in the jail than the 3.7 needed:
/etc/pam.d
/etc/security
/lib/libpam*
(I've tried this with openssh-3.9_p1 only.) |
|
Back to top |
|
|
echo6 Guru
Joined: 04 Jan 2003 Posts: 587
|
Posted: Sat Sep 04, 2004 6:07 pm Post subject: |
|
|
hanj wrote: | Looks like vsftpd2 supports SSL.. maybe something to look at.. |
Ah!..good point.
Thanks. |
|
Back to top |
|
|
sbonnell n00b
Joined: 29 Jan 2004 Posts: 14 Location: Paris, France
|
Posted: Sat Sep 04, 2004 7:24 pm Post subject: rssh |
|
|
You may have a look at rssh. It's used to restrict the access to ssh functions.
Regards,
Stephane |
|
Back to top |
|
|
Matrixmonkey n00b
Joined: 18 Apr 2003 Posts: 43 Location: Bradford,UK
|
Posted: Sun Sep 05, 2004 1:18 pm Post subject: |
|
|
the answer
when my sister was on holiday i stole her pc and install gentoo on it
mawwwaaahhh nice and secure server and client now _________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.dicknlyd.co.uk |
|
Back to top |
|
|
echo6 Guru
Joined: 04 Jan 2003 Posts: 587
|
Posted: Tue Sep 07, 2004 9:30 pm Post subject: Re: rssh |
|
|
sbonnell wrote: | You may have a look at rssh. It's used to restrict the access to ssh functions.
Regards,
Stephane |
Excellent, thanks |
|
Back to top |
|
|
Jaxom Tux's lil' helper
Joined: 31 Jan 2003 Posts: 137
|
Posted: Tue Sep 07, 2004 9:49 pm Post subject: |
|
|
I use vsftpd, I read in the man pages about changing some things around to allow anonymous logons without passwords. And you can set quite a bit of other security level stuff in it as well. Hence the name Very Secure FTP Daemon _________________ Undisputed Heavyweight Champion. If it's undisputed, WHAT'S ALL THE FIGHTING ABOUT?!?! -- George Carlin |
|
Back to top |
|
|
badchien Guru
Joined: 16 Feb 2004 Posts: 415 Location: doghouse
|
Posted: Tue Sep 14, 2004 3:37 pm Post subject: |
|
|
echo6 wrote: | So what is the answer?
How do you allow an account for sftp access and disable ssh access? |
Someone told me that this works to allow sftp only, not ssh-- change their shell like this:
Code: |
chsh -s /usr/lib/misc/sftp-server someuser
|
|
|
Back to top |
|
|
echo6 Guru
Joined: 04 Jan 2003 Posts: 587
|
Posted: Thu Oct 14, 2004 8:08 am Post subject: |
|
|
badchien wrote: | Code: |
chsh -s /usr/lib/misc/sftp-server someuser
|
|
Of course!! yes very simple, I'll give that a try, many thanks |
|
Back to top |
|
|
To Veteran
Joined: 12 Apr 2003 Posts: 1145 Location: Coimbra, Portugal
|
Posted: Thu Oct 14, 2004 8:49 am Post subject: |
|
|
Jaxom wrote: | I use vsftpd, I read in the man pages about changing some things around to allow anonymous logons without passwords. And you can set quite a bit of other security level stuff in it as well. Hence the name Very Secure FTP Daemon |
One more vote for vsftpd
Tó _________________
------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------ |
|
Back to top |
|
|
cpdsaorg Guru
Joined: 16 Oct 2003 Posts: 359
|
Posted: Fri Jul 29, 2005 12:39 pm Post subject: |
|
|
just curious, when you install sshd does the sftp and ssh functionality keep seperate access control lists? I thought ssh had an allow or deny list? or am i mixing that up with ftp? _________________ PentiumM 2.0 GHz, MSI 915GM Speedster-FA4, Seagate ST3500641AS SATA 400GB |
|
Back to top |
|
|
|