Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
secure ftp? for select number of users
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Matrixmonkey
n00b
n00b


Joined: 18 Apr 2003
Posts: 43
Location: Bradford,UK

PostPosted: Sun Aug 22, 2004 11:21 am    Post subject: secure ftp? for select number of users Reply with quote

i need to set up a ftp server but only ftp :twisted: NO shell access :evil:
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
View user's profile Send private message
bunsen
Tux's lil' helper
Tux's lil' helper


Joined: 10 Aug 2003
Posts: 105

PostPosted: Sun Aug 22, 2004 11:30 am    Post subject: Reply with quote

openssh ships with sftp. I've not used it, so can't say whether it's of any use to you.
Back to top
View user's profile Send private message
Matrixmonkey
n00b
n00b


Joined: 18 Apr 2003
Posts: 43
Location: Bradford,UK

PostPosted: Sun Aug 22, 2004 2:59 pm    Post subject: Reply with quote

ahhh forgot to say the users are windows users and thick ones at that :D so would need a windows client

:lol: :lol: :lol: :lol: :lol:

keep trying to turn them to the light side of the force but :( no joy

the dark side is stronger :twisted:
_________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://www.dicknlyd.co.uk
Back to top
View user's profile Send private message
jonnymalm
n00b
n00b


Joined: 26 Jun 2002
Posts: 68

PostPosted: Sun Aug 22, 2004 3:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Sat Sep 04, 2004 1:30 pm    Post subject: Reply with quote

So what is the answer?

How do you allow an account for sftp access and disable ssh access?
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Sat Sep 04, 2004 2:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Sat Sep 04, 2004 2:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Sat Sep 04, 2004 4:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Sat Sep 04, 2004 4:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Sat Sep 04, 2004 5:04 pm    Post subject: Reply with quote

Looks like vsftpd2 supports SSL.. maybe something to look at..

https://forums.gentoo.org/viewtopic.php?t=201071

hanji
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Sat Sep 04, 2004 5:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Sat Sep 04, 2004 6:07 pm    Post subject: Reply with quote

hanj wrote:
Looks like vsftpd2 supports SSL.. maybe something to look at..


Ah!..good point.

Thanks.
Back to top
View user's profile Send private message
sbonnell
n00b
n00b


Joined: 29 Jan 2004
Posts: 14
Location: Paris, France

PostPosted: Sat Sep 04, 2004 7:24 pm    Post subject: rssh Reply with quote

You may have a look at rssh. It's used to restrict the access to ssh functions.

Regards,
Stephane
Back to top
View user's profile Send private message
Matrixmonkey
n00b
n00b


Joined: 18 Apr 2003
Posts: 43
Location: Bradford,UK

PostPosted: Sun Sep 05, 2004 1:18 pm    Post subject: Reply with quote

the answer :D

when my sister was on holiday :D i stole her pc and install gentoo on it :D


mawwwaaahhh :D nice and secure server and client now :D
_________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://www.dicknlyd.co.uk
Back to top
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Tue Sep 07, 2004 9:30 pm    Post subject: Re: rssh Reply with quote

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
View user's profile Send private message
Jaxom
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jan 2003
Posts: 137

PostPosted: Tue Sep 07, 2004 9:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
badchien
Guru
Guru


Joined: 16 Feb 2004
Posts: 415
Location: doghouse

PostPosted: Tue Sep 14, 2004 3:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Thu Oct 14, 2004 8:08 am    Post subject: Reply with quote

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
View user's profile Send private message
To
Veteran
Veteran


Joined: 12 Apr 2003
Posts: 1145
Location: Coimbra, Portugal

PostPosted: Thu Oct 14, 2004 8:49 am    Post subject: Reply with quote

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


_________________

------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------
Back to top
View user's profile Send private message
cpdsaorg
Guru
Guru


Joined: 16 Oct 2003
Posts: 359

PostPosted: Fri Jul 29, 2005 12:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum