| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-11-2009, 03:59 AM
|
#1
|
|
Member
Registered: Jan 2007
Location: Provo, UT
Distribution: OSX
Posts: 451
Rep:
|
How to restrict users ssh permissions?
Hi, I'm new to server, I have successfully set up a file server sharing different partitions to different users. I have noticed that I have a vulnerability on the SSH end though. I find that all of my users can ssh and cd to partitions that I would like restricted. These partitions are mounted as /media/dirname how can I restrict guests ssh access so that in terms of ssh they are not allowed to leave their home directory? I'd like it so that I can be the only one to have permissions to everything. I believe that my users do have their own groups but I'm not sure, seeing as I'm asking this question I think I'll need some help from where to start from where to end.
Much thanks.
MJ
*server is ubuntu 9.10 with samba
|
|
|
|
12-11-2009, 04:33 AM
|
#2
|
|
Member
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806
Rep:
|
|
|
|
|
12-11-2009, 04:37 AM
|
#3
|
|
Senior Member
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137
Rep: 
|
Quote:
Originally Posted by mitchell7man
Hi, I'm new to server, I have successfully set up a file server sharing different partitions to different users. I have noticed that I have a vulnerability on the SSH end though. I find that all of my users can ssh and cd to partitions that I would like restricted. These partitions are mounted as /media/dirname how can I restrict guests ssh access so that in terms of ssh they are not allowed to leave their home directory? I'd like it so that I can be the only one to have permissions to everything. I believe that my users do have their own groups but I'm not sure, seeing as I'm asking this question I think I'll need some help from where to start from where to end.
Much thanks.
MJ
*server is ubuntu 9.10 with samba
|
if a user is restricted to their home directory, they cannot run any commands..
what you should look at is setting a user up with ssh keys, and specifying in the ssh keys which commands they can run.
another option would be to set up some rules in /etc/sudoers
some examples are here
http://debaan.blogspot.com/2007/02/s...-examples.html
|
|
|
|
12-11-2009, 12:03 PM
|
#4
|
|
Member
Registered: Jan 2007
Location: Provo, UT
Distribution: OSX
Posts: 451
Original Poster
Rep:
|
Those are interesting, but I actually don't mind (and actually would like) if these users were not allowed to execute any commands at all, how do I go about restricting them completely? I didn't quite get that first tutorial as it seemed to be for FTP, I already have my users made and set up to be able to access certain SAMBA shares. I just need to lock them out of SSH.
Thanks again.
|
|
|
|
12-11-2009, 12:40 PM
|
#5
|
|
Member
Registered: Jan 2007
Location: Provo, UT
Distribution: OSX
Posts: 451
Original Poster
Rep:
|
Okay, so now I got a bigger problem i changed the value to
Quote:
|
root ALL=(myusername) ALL
|
and now I cannot sudo... Is there any way to fix my sudo permissions? - I intended to lock everyone out except for myself. Now I just made my account the same as the rest, I can look at stuff but not edit it. (And I want my account to be able to do anything and the users to not even look at stuff)
Thanks.
MJ
UPDATE - I guess I did have root account active and was able to change the value back to (ALL). -I still need help restricting other accounts. I guess you can see what kind of novice your working with...
Last edited by mitchell7man; 12-11-2009 at 12:48 PM.
|
|
|
|
12-11-2009, 10:14 PM
|
#6
|
|
Member
Registered: Jan 2007
Location: Provo, UT
Distribution: OSX
Posts: 451
Original Poster
Rep:
|
Quote:
|
usermod -s /sbin/nologin username
|
seemed to do the trick  Thanks all!
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:35 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|