Help!

Prevent ssh login

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> SUSE RSS
Next:  [Samba] Can No Longer Join to Domain  
Author Message
Chris
External


Since: Sep 14, 2006
Posts: 21



PostPosted: Fri Mar 23, 2007 1:50 pm    Post subject: Prevent ssh login
Archived from groups: alt>os>linux>suse (more info?)

This may seem odd, but how do I prevent a user from logging in via ssh?

I want to give one particular user FTP access and no access of any other
kind. I'm using vsftpd.
Back to top
Eric
External


Since: Mar 05, 2007
Posts: 47



PostPosted: Fri Mar 23, 2007 4:00 pm    Post subject: Re: Prevent ssh login [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Chris wrote:
> This may seem odd, but how do I prevent a user from logging in via ssh?
>
> I want to give one particular user FTP access and no access of any other
> kind. I'm using vsftpd.

first link on google will lead to...

http://www.cyberciti.biz/tips/openssh-deny-or-restrict-access-to-users...d-group
Back to top
Mark Nenadov
External


Since: Mar 03, 2007
Posts: 4



PostPosted: Fri Mar 23, 2007 7:11 pm    Post subject: Re: Prevent ssh login [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 23 Mar 2007 20:34:52 +0100, Eric wrote:

> Chris wrote:
>> This may seem odd, but how do I prevent a user from logging in via ssh?
>>
>> I want to give one particular user FTP access and no access of any other
>> kind. I'm using vsftpd.
>
> first link on google will lead to...
>
> http://www.cyberciti.biz/tips/openssh-deny-or-restrict-access-to-
-and-groups.html


That may be the first link google gives, but it isn't necessarily the best
solution.

Yes, you can deny users access in the SSHD config. However, going by the
principle of not giving a user more access then they need, a better
solution in view of the FTP-only requirement would be changing that users
shell to /sbin/nologin

--

Mark Nenadov -> skype: marknenadov, web: http://www.marknenadov.com
-> "Careful, monsieur, with me. Do not tangle with me.
I'm a trained expert in karate. My hands are lethal weapons!"
-- Peter Sellers in A Shot In The Dark
Back to top
David Bolt
External


Since: Feb 14, 2006
Posts: 526



PostPosted: Fri Mar 23, 2007 9:00 pm    Post subject: Re: Prevent ssh login [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 23 Mar 2007, Chris <spam_me_not.RemoveThis@goaway.com> wrote:-

>This may seem odd, but how do I prevent a user from logging in via ssh?
>
>I want to give one particular user FTP access and no access of any
>other kind. I'm using vsftpd.

The way I've done it is to change the shell to /bin/true for the users
you don't wish to have shell access. Doing this means they can't log in,
even if they have direct access to the system[0]. It doesn't stop them
from being able to use FTP and/or POP3 for mail[1], which is ideal for
the few users I've used this for.


[0] They can su - <username> -s /bin/bash but need access to another
account that _does_ have a usable login shell.

[1] Can you say web server and POP3 mailbox hosting Smile

Regards,
David Bolt

--
Member of Team Acorn checking nodes at 50 Mnodes/s: http://www.distributed.net/
RISCOS 3.11 | SUSE 10.0 32bit | SUSE 10.1 32bit | openSUSE 10.2 32bit
RISCOS 3.6 | SUSE 10.0 64bit | SUSE 10.1 64bit | openSUSE 10.2 64bit
TOS 4.02 | SUSE 9.3 32bit | | openSUSE 10.3a1 32bit
Back to top
DrE
External


Since: Mar 12, 2007
Posts: 22



PostPosted: Sat Mar 24, 2007 11:00 am    Post subject: Re: Prevent ssh login [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Chris schreef:
> This may seem odd, but how do I prevent a user from logging in via ssh?
>
> I want to give one particular user FTP access and no access of any other
> kind. I'm using vsftpd.
Just put "AllowUsers user1 user2 user3" in sshd_config. Otherwise use
DenyUsers.

Dre
Back to top
Matthew Wild
External


Since: May 30, 2006
Posts: 10



PostPosted: Tue Apr 03, 2007 11:21 am    Post subject: Re: Prevent ssh login [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mark Nenadov wrote:
> On Fri, 23 Mar 2007 20:34:52 +0100, Eric wrote:
>
>> Chris wrote:
>>> This may seem odd, but how do I prevent a user from logging in via ssh?
>>>
>>> I want to give one particular user FTP access and no access of any other
>>> kind. I'm using vsftpd.
>> first link on google will lead to...
>>
>> http://www.cyberciti.biz/tips/openssh-deny-or-restrict-access-to-
> -and-groups.html
>
>
> That may be the first link google gives, but it isn't necessarily the best
> solution.
>
> Yes, you can deny users access in the SSHD config. However, going by the
> principle of not giving a user more access then they need, a better
> solution in view of the FTP-only requirement would be changing that users
> shell to /sbin/nologin
>

Do they even need to be a full user? You could set them up as a virtual
ftp user, who then only has access to things via vsftpd.

Matthew
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> SUSE All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can 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