LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 08-17-2006, 12:24 PM   #1
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Rep: Reputation: 30
limiting linux users abilities


for my webserver i want to give someone ftp access to their webs root directory. which i have that setup. just im not using a FTP server. theyre connecting via ssh. meaning using the ssh client they could do all sorts of things within their home directory ie installing bandwidth eating servers and running them installing anything really is what i dont want.

bassicaly i want to limit the user so he can only upload and download files so it would be working as if he was conncted via ftp
 
Old 08-17-2006, 01:28 PM   #2
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Rep: Reputation: 15
make /, and /home unreadable to anyone but the owner (you). You may have to do this to all of the other directories so they don't CD into them.
That is assuming that they actually have user accounts, and the SHOULD as they can SSH into your server with out using a pubilc account...
That would just keep them in their home dir...
I know that there is a way to disable shell access, so they could only use SCP. I think a google search for "Disabling Shell Access" would do you some good if you were intrested in that.

Last edited by timothyb89; 08-17-2006 at 01:31 PM.
 
Old 08-17-2006, 01:29 PM   #3
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189

Rep: Reputation: 49
what you could do here is chmod the /usr/bin/* to 750, so a user wont have access to any of the files in /usr/bin.
then you can chmod 755 scp and the other commands that you want.


This might cause problems, so test on a system first.

Last edited by w3bd3vil; 08-17-2006 at 01:30 PM.
 
Old 08-17-2006, 01:53 PM   #4
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
sorry my post was confusing

im trying to set up an access to the server for similar reasons as a FTP server. just for uploading and downloading files with the server. i dont have a ftp server installed. i just created a unix user and the unix users home directory is their web root directory. the user logs in via ssh client. i have it setup so they cant naviagte out of their home directory, just i dont want them to be able to upload files then execute them. (im not sure if theres anything else i should keep them from doing) the only stuff they need to do is the bare minimum to upload files to the server for their website, and then be able to download them incase they need to make backups or whatever the purpose is.
 
Old 08-17-2006, 03:37 PM   #5
Matir
Moderator
 
Registered: Nov 2004
Location: Kennesaw, GA
Distribution: Ubuntu
Posts: 8,502

Rep: Reputation: 110Reputation: 110
Just run:
Code:
usermod -s /usr/lib/sftp-server username
This will ONLY allow the user access via sftp.
 
Old 08-18-2006, 06:52 PM   #6
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Rep: Reputation: 15
Quote:
Originally Posted by w3bd3vil
what you could do here is chmod the /usr/bin/* to 750, so a user wont have access to any of the files in /usr/bin.
then you can chmod 755 scp and the other commands that you want.


This might cause problems, so test on a system first.
To prevent them from leaving their home dirs, just follow the directions in my post.
The post I quoted will prevent them from running they shouldn't.
Them you can chmod things like sshd (which is normally in sbin, but...), gedit or emacs and xemacs to give them an online editor.
If you are planning on letting then use shell scripts, just chmod 777 /usr/bin/sh alond with the other needed commands.
That should give you decent security...



Linux users SHOULD be able to ssh and scp. Windows users can use Cygwin for SSH (open the X server and then xterm) and then they can scp and run the editors.
Windows users can also use programs like WinSCP for file transfer. Th shoudn't have to navigate into their home directors as that's where you start off...

Last edited by timothyb89; 08-18-2006 at 06:56 PM.
 
  


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
limiting space for new users spooge Linux - General 2 01-28-2006 10:08 AM
limiting users using gradm/acl ruleman Linux - Security 6 06-19-2004 04:55 AM
Limiting Users Obie Linux - Security 6 05-29-2004 05:01 PM
Limiting users RedHatter Linux - Security 7 08-30-2002 05:03 AM
limiting users access iquadri1 Linux - Networking 1 09-04-2001 01:23 PM


All times are GMT -5. The time now is 08:27 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