LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-26-2009, 07:13 PM   #1
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
is there an easy way to disable ssh for everyone but root?


Is there an easy way to disable ssh for everyone but root?
 
Old 11-26-2009, 11:46 PM   #2
splunk
Member
 
Registered: Jan 2007
Location: PA, USA
Distribution: Ubuntu Jaunty (9.04)
Posts: 31

Rep: Reputation: 16
Yes.

But it is highly recommended to disable logins by the root user.

Instead, you should login as a normal user and then use su or sudo to become root.
 
Old 11-27-2009, 12:28 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I agree. Why would you be asking for this?
 
Old 11-27-2009, 08:52 AM   #4
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by unSpawn View Post
I agree. Why would you be asking for this?
I have several servers that write to one particular server to do backups, and I want to allow them access only on day a month, and then disable it.

I have a pretty strong root password and brute force detector, and ACL, so I'm not too worried about root login being allowed.
 
Old 11-27-2009, 10:24 AM   #5
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 299

Rep: Reputation: 62
Sure. Look at the AllowUsers option in sshd_config.
 
Old 11-27-2009, 10:31 AM   #6
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by fpmurphy View Post
Sure. Look at the AllowUsers option in sshd_config.
Thanks!

I have the server offline now, is this correct:
Code:
AllowUsers root
to allow root only

Code:
#AllowUsers root
and then comment that line to allow everyone?
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Root login via ssh UltraSoul Solaris / OpenSolaris 3 02-09-2007 02:18 AM
Disable Root Login Via SSH = Why? carlosinfl Linux - Security 4 10-11-2006 12:32 PM
Disable root on ssh but not on winscp ALInux Linux - Security 3 04-23-2006 11:14 AM
disable root login with ssh linuxtesting2 Slackware 3 02-16-2005 12:33 PM
How can I disable root to ssh Soulstealer Linux - Security 2 12-12-2004 11:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:16 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration