Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| 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. |
|
 |
08-07-2009, 01:00 AM
|
#1
|
|
Member
Registered: Mar 2008
Distribution: fedora
Posts: 196
Rep:
|
starting sshd by normal user
I want the sshd deamon to run with normal user privliges rather than with root.
can anybody please help me how to do this.
I tried by adding the following line in the /etc/sudoers
username ALL=/etc/service ALL
after that I executed the command "/sbin/service sshd start"
it failed because ssh_conf and key files are readable only by root.
I don't know how to use this sudoers file. I gone through the man page but still, somehow, I was not able to understand it.
Last edited by chakka.lokesh; 08-07-2009 at 01:01 AM.
|
|
|
|
08-07-2009, 01:15 AM
|
#2
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,021
|
If you want sshd to run without being root at all, you'd have to move it to a port num >= 1024.
In any case, the default is for it to drop privileges for each cxn http://74.125.155.132/search?q=cache...naltosend.netA
/+ssh+drop+privileges&cd=7&hl=en&ct=clnk&gl=au
This is similar to Apache for instance.
If you just want to avoid the script kiddies, disallow root from from using ssh.
Setup another user and 'su -' to root from there.
Last edited by chrism01; 08-07-2009 at 01:17 AM.
|
|
|
|
08-08-2009, 11:22 PM
|
#3
|
|
Member
Registered: Mar 2008
Distribution: fedora
Posts: 196
Original Poster
Rep:
|
Quote:
Originally Posted by chrism01
If you just want to avoid the script kiddies, disallow root from from using ssh.
Setup another user and 'su -' to root from there.
|
I already setted Permitrootlogin no
I want the process itself to run with unpreviliged user as owner instead of root.
|
|
|
|
08-08-2009, 11:25 PM
|
#4
|
|
Member
Registered: Mar 2008
Distribution: fedora
Posts: 196
Original Poster
Rep:
|
Quote:
Originally Posted by chrism01
If you want sshd to run without being root at all, you'd have to move it to a port num >= 1024.
|
I want it to run. It doesn't matter on which port it is running.
|
|
|
|
08-09-2009, 12:51 AM
|
#5
|
|
Senior Member
Registered: Jan 2006
Posts: 4,362
Rep: 
|
I guess I am a little confused about why you would want to do it this way. You do understand that you can setup the sshd to run at boot and that any user can then access the machine this way?
|
|
|
|
08-10-2009, 09:15 PM
|
#6
|
|
Member
Registered: Mar 2008
Distribution: fedora
Posts: 196
Original Poster
Rep:
|
I want only one user to access it.
Also I want to restrict the access only a particular location.
|
|
|
|
08-10-2009, 10:09 PM
|
#7
|
|
Senior Member
Registered: Jan 2006
Posts: 4,362
Rep: 
|
An you can accomplish both those things without running sshd as a user.
|
|
|
|
08-10-2009, 11:34 PM
|
#8
|
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,780
|
In sshd_config
Code:
PermitRootLogin no
AllowUsers wim brian
The first line is a good habit (most attacks are on the root account).
The second line only allows users wim and brian to login using SSH.
Further I would consider 'passwordless login'.
To limit access to certain locations, read up on 'jail users'.
|
|
|
|
08-10-2009, 11:47 PM
|
#9
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,021
|
If you mean 'from' a particular location, lookup tcp wrappers : http://itso.iu.edu/TCP_Wrappers
|
|
|
|
08-12-2009, 12:59 AM
|
#10
|
|
Member
Registered: Mar 2008
Distribution: fedora
Posts: 196
Original Poster
Rep:
|
Quote:
Originally Posted by Wim Sturkenboom
In sshd_config
Code:
PermitRootLogin no
AllowUsers wim brian
The second line only allows users wim and brian to login using SSH.
|
Are you sure of this??
|
|
|
|
08-12-2009, 02:00 AM
|
#11
|
|
Member
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374
Rep:
|
Yes, that's the correct config. But why would you post back and ask when you could just... try it?
|
|
|
|
08-12-2009, 02:21 AM
|
#12
|
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,780
|
Quote:
Originally Posted by chakka.lokesh
Are you sure of this??
|
Can you read man pages
From man sshd_config
Code:
AllowUsers
This keyword can be followed by a list of user name patterns,
separated by spaces. If specified, login is allowed only for
user names that match one of the patterns. `*' and `?' can be
used as wildcards in the patterns. Only user names are valid; a
numerical user ID is not recognized. By default, login is
allowed for all users. If the pattern takes the form USER@HOST
then USER and HOST are separately checked, restricting logins to
particular users from particular hosts.
|
|
|
|
08-13-2009, 01:21 AM
|
#13
|
|
Member
Registered: Mar 2008
Distribution: fedora
Posts: 196
Original Poster
Rep:
|
Quote:
Originally Posted by karamarisan
Yes, that's the correct config. But why would you post back and ask when you could just... try it?
|
oops.... I was a bit confused.
It is working correctly now.
Earlier it happened some thing else.
I think I might have did any mistake.
thanks for the help.
I got what I want.
thanks once again.
|
|
|
|
| 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 02:10 AM.
|
|
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
|
|