LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-20-2007, 01:08 AM   #1
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 36
sshd block user access


how to block a particular user from accessing to the machine via ssh?
but i still wan't to have the user be able to access the SFTP server witch is a subcategory of sshd

IP blocking will not work as the user might have a dynamic IP address
and giving the user a fake password will not work as well as the user needs the password to access FTP and/or SFTP
 
Old 01-20-2007, 02:06 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: At home: Arch, OpenBSD, Solaris. At work: CentOS, Debian, Ubuntu
Posts: 3,625

Rep: Reputation: 101Reputation: 101
I've never done this myself, but from what I've heard the best way to do this is to use [URL=http://sublimation.org/scponly/wiki/index.php/Main_Page]scponly[/URL} (which also supports SFTP).
 
Old 01-20-2007, 02:51 AM   #3
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
Is this a regular user with an account on the machine for other purposes? I wonder if sftp would function if you replaced this shell with /bin/false.
 
Old 01-20-2007, 05:18 AM   #4
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Original Poster
Rep: Reputation: 36
this is a regural user without access to machine via ssh
only with FTP or SFTP
if i can't get SFTP to work, i'll just use FTP then, it's no big problem

could i also do a group thats not permited to login through ssh?
so that i would create a group named nossh or something
and set this group as a group to a user, so that every user in this group wouldn't have access to ssh?

edit: if i set a users shell to /bin/false it doesn't work
tried that one...not on purpose when i changes roots shell to /bin/false by mistake
 
Old 01-20-2007, 08:32 AM   #5
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
I think that if you deny someone ssh access that you also deny them sftp access, but I'm not certain. The sftp manpage refers to sshd_config. Read through the sshd_config manpage. You can use DenyGroups, but using AllowGroups to allow only the authorized groups may be a better idea. Using this denies all other groups.

There is a "Subsystem" entry but I don't know if these options would allow someone denied with DenyGroups. I kind of doubt it.

It sounds like the "scponly" option is the way to go. That is why why they wrote it I suppose.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
by using iptables block mac address to restric user to access internet Farrukh Fida Linux - Networking 3 10-09-2006 07:59 AM
FC4-Starting sshd: Privilege separation user sshd does not exist FAILED kiranherekar Fedora 5 12-29-2005 02:22 PM
block internal user to access external proxy server ckamheng Linux - Security 7 09-09-2005 03:37 AM
How can I block net access for 1 user? jimk Linux - Security 10 11-26-2004 11:43 AM
block local user to access a site xen_chris Linux - Newbie 3 04-15-2003 09:55 AM


All times are GMT -5. The time now is 08:58 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration