LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-20-2014, 12:25 PM   #1
karl29
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Rep: Reputation: Disabled
How to use the PermitRootLogin no ?


Hi,
I have a VPS, and I login as root to update the system.
I do use the key also, but wanted to disable the root user.

The thing is that the only user permitted to ssh is root. All the other accounts are not permitted.

So, if I disable root, how can I sudo if there isn't any other user account allowed to ssh?
 
Old 04-20-2014, 12:37 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by karl29 View Post
Hi,
I have a VPS, and I login as root to update the system.
I do use the key also, but wanted to disable the root user.

The thing is that the only user permitted to ssh is root. All the other accounts are not permitted.

So, if I disable root, how can I sudo if there isn't any other user account allowed to ssh?
seems backward. by default i think most distros disable root remote login so that normal users would have to use sudo to do anything dangerous.
 
Old 04-20-2014, 12:54 PM   #3
karl29
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Please correct me if I'm wrong.

In my case I have the root user which has ssh permission and also to login to WHM

Then I have more accounts limited to cpanel only. With no ssh.

If I disable ssh for root, can I enable ssh for any other user (example name: matsite) and then if I want to update the system, I can sudo from matsite and will be able to update?
 
Old 04-20-2014, 04:57 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
the sshd_config file has a directive called allowusers.



i wasnt gonna post this part so not to sound sarcastic but the stupid thing to do would be disable root login first without allowing anyone else to login. which would be like locking yourself out of your house.

Last edited by schneidz; 04-20-2014 at 05:02 PM.
 
  


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
PermitRootLogin no - Not working! Buto Linux - Security 3 04-01-2007 11:41 AM
SSH and PermitRootLogin Help Please imurderer Linux - Security 3 11-14-2003 05:19 PM
SSH2 and PermitRootLogin=No mark2117 Linux - Security 10 10-23-2003 10:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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