LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 09-29-2021, 02:57 AM   #1
potkor
LQ Newbie
 
Registered: Sep 2021
Posts: 3

Rep: Reputation: Disabled
[Q] How to find what uses root.


Hello,

I have a problem where after closing the ssh access for root I have a lot of failed login attempts. Any idea how can I find what is causing this?

[myuser@mycomputer ~ ]$ su -
Password:
Last login: Tue Sep 14 06:01:53 +03 2021 on pts/6
Last failed login: Tue Sep 14 06:03:14 +03 2021 from mycomputer on ssh:notty
There were 48 failed login attempts since the last successful login.


[myuser@mycomputer ~ ]$ su -
Password:
Last login: Tue Sep 14 06:03:16 +03 2021 on pts/4
Last failed login: Tue Sep 14 06:07:00 +03 2021 from mycomputer on ssh:notty
There were 116 failed login attempts since the last successful login.

I figured 'ps -elf|grep root', but I'm not sure if that is the only way to find out.

Appreciate your help.
 
Old 09-29-2021, 03:00 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
Hi, and welcome here, at LQ!

I would check the network traffic.
 
1 members found this post helpful.
Old 09-29-2021, 03:39 AM   #3
potkor
LQ Newbie
 
Registered: Sep 2021
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi, thank you.

So I should check network traffic for example with nestat -natpe? Im not rly sure what the user id refers to though.. i suppose its the one from passwd file?
And do you think the ps -elf is relevant for information?
 
Old 09-29-2021, 04:07 AM   #4
lvm_
Member
 
Registered: Jul 2020
Posts: 983

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
On most systems authentication events including destination port are logged in /var/log/auth.log and you can try to find which process is accessing this port
 
1 members found this post helpful.
Old 09-29-2021, 04:19 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
if they were all ssh access attempts you can check the logs of sshd (probably). Also you may try to change debug/verbosity to see more.
 
Old 09-29-2021, 04:26 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,783

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
If you have allowed internet access to the computer using ssh and allow ssh passwords it is someone trying to brute force there way in. Hopefully, root ssh root login is disabled. They will eventually move on. Make sure you are using strong passwords or better yet only use keys. To slow them down some you can use fail2ban.
 
Old 09-29-2021, 06:44 PM   #7
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,249

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
Just bypass the problem. Don't allow anyone to SSH in without an exchange of public keys.
 
Old 09-29-2021, 07:31 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,381
Blog Entries: 28

Rep: Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163
You might also install fail2ban, if you have not already done so. It should be in your repos.
 
Old 09-30-2021, 02:22 AM   #9
potkor
LQ Newbie
 
Registered: Sep 2021
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks guys.
Ill check those things and hopefully figure it out.
Really appreciate your help!
Cheers
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Microsoft's Charm Offensive Against GNU/Linux Uses the Same Media Strategy Donald Trump Uses LXer Syndicated Linux News 0 04-04-2016 06:13 AM
Root Password & Uses of .conf files arut Solaris / OpenSolaris 2 01-04-2005 11:18 AM
xinetd uses service --> slackware uses ??? kntgtaid Slackware 1 06-06-2004 02:10 PM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM
c programs and root uses dmaxj Linux - General 2 06-26-2003 11:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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