LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-06-2016, 02:32 PM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Deleted User Account Is Trying to Log Into A Linux Server


So this keeps coming up and I can't seem to find an answer for it.

I have a user ron, who has left the company more then a year ago. I've upgraded the logging from syslog to rsyslog and now I'm seeing that this user ron is trying to log into two of my Linux servers.

Code:
server sshd[4346]: Invalid user ron from 143.83.xxx.xxx
 server sshd[4346]: input_userauth_request: invalid user ron
 server sshd[4346]: Failed none for invalid user ron from 143.83.xxx.xxx port 55808 ssh2
 server sshd[4346]: Failed publickey for invalid user ron from 143.83.xxx.xxx port 55808 ssh2
 server sshd[4346]: Failed password for invalid user ron from 143.83.xxx.xxx port 55808 ssh2
 server sshd[4346]: Connection closed by 143.83.xxx.xxx
Again ron doesn't have an account on either server and I've used

Code:
find / -user ron

grep 'ron' /etc/passwd 
grep 'ron' /etc/group
To confirm this

I did clean up under /etc/ssh/sshd_config the following:

Code:
AllowGroup ron
I've removed ron and restarted sshd and still getting this.

Also where is this public key coming into this? Could this user's public key be on one of the system's?

thanks

Last edited by JockVSJock; 01-06-2016 at 02:34 PM.
 
Old 01-06-2016, 02:39 PM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
So? Ron is trying to get back in. You (wisely) locked him out by deleting the account. What is your worry? A lot of former (fired?) employees try this...just to see if they can...on a quiet/boring moment in their life...
I'd not get too worried...
I bet Ron could log in remotely, hence the SSH key...that now is..invalid...too bad for him...
Good for you, however, on closing the gaps that allow him to come back in...
Melissa
 
Old 01-06-2016, 02:42 PM   #3
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
My worry is that this network that my Linux servers are on is on a closed subnet, which means no one from the outside can get in.

So either 'ron' has found a way in or there is something else going on.
 
Old 01-06-2016, 02:46 PM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
My worry is that this network that my Linux servers are on is on a closed subnet, which means no one from the outside can get in.
No internet?
Quote:
So either 'ron' has found a way in or there is something else going on.
Okay, granted, that'd be super spooky...
So, the SSH, suggests a remote login...
How big/open/accessible is the infrastructure?
Melissa
Edit - the IP address suggests a non-local origin. Or...you have a malconfigured LAN there...
The IP addresses should be inside the prescribed ranges...

Last edited by ButterflyMelissa; 01-06-2016 at 02:48 PM.
 
Old 01-07-2016, 07:41 AM   #5
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
So while at home, I had the idea to search for ron's public key, which is basically me searching for all public keys on the system.

Code:
find / -type f -name "*.pub"

Besides my public key, it turned up a number of keys

Code:
Besides my public ssh key, it turned up a number of keys 
/var/run/pcscd.pub 
/usr/lib/perl5/5.8.8/CPAN/PAUSE2003.pub 
/etc/ssh/ssh_host_key.pub 
/etc/ssh/ssh_host_rsa_key.pub 
/etc/ssh/ssh_host_dsa_key.pub
/root/.ssh/id_rsa.pub 
/root/.ssh/d50.id_rsa.pub 
/root/.ssh/d238.id_rsa.pub 
/root/.ssh/junk/id_rsa.pub
Using cat, all of the keys under /root are tied to root. However should these be there? If I try to login with ssh keys as root it doesn't work, so can I delete these?

Also the rsa, dsa and the other .pub key are standard under /etc/ssh, correct?
 
Old 01-07-2016, 07:57 AM   #6
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by JockVSJock View Post
My worry is that this network that my Linux servers are on is on a closed subnet, which means no one from the outside can get in.

So either 'ron' has found a way in or there is something else going on.
Doesn't the IP address from where he attempts to log in, 143.83.x.y, give you a clue?
 
Old 01-07-2016, 08:03 AM   #7
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Yes and no.

Yes it is coming from a server that is on that closed subnet and I've deleted ron's account (I lock the accounts for 60 to 90 days, to see if anything breaks or if there is anything I need and then I delete the account) on all Linux servers.

No in that the rsyslog is showing ron's public key is trying to connect to two other Linux servers on that closed subnet. Maybe this is some sort of cronjob, that I will have to look at?

Again I searched for all public keys on those servers and can't find anything.
 
Old 01-07-2016, 09:20 AM   #8
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Yes it is coming from a server that is on that closed subnet
I think I have half of your solution righ there...the IP address...
I suspect that "ron" accidentally is someone else...or...someTHING else...
A network HAS (per RFC1918) fall into a class...that means: use IP adresses set aside for private networks...
Your network has (I suspect) connection to the internet...that is a way out...and in...
Can you do a WHOIS on the complete IP address? I bet it comes up with an "owner" of that address...
Melissa
(intrigued by this post)
 
Old 01-07-2016, 09:33 AM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Thor_2.0 View Post
No internet?

Okay, granted, that'd be super spooky...
You'all better sit down.
Some of 143.83.0.0 is assigned to the Department of Defense.
http://www.tcpiputils.com/browse/ip-address/143.83.0.0

"spooky" indeed.
 
1 members found this post helpful.
Old 01-07-2016, 09:42 AM   #10
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Some of 143.83.0.0 is assigned to the Department of Defense.
Yep...and...an INTERNAL IP address should NOT fall outside the assigned class boundries...
Quote:
"spooky" indeed.
At the very least...
Melissa
 
Old 01-07-2016, 03:15 PM   #11
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Thor_2.0 View Post
Yep...and...an INTERNAL IP address should NOT fall outside the assigned class boundries...

At the very least...
Melissa
I love a good mystery, but spook stuff always well, spooks me.
I wanna know the actual IP.

Time for the movie Sneakers!
 
Old 01-08-2016, 05:59 AM   #12
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by Thor_2.0 View Post
Yep...and...an INTERNAL IP address should NOT fall outside the assigned class boundries...


Melissa
I don't understand what this means?

The IPv4 classes (Class A, B, C and D of IPv4)?

Last edited by JockVSJock; 01-08-2016 at 06:04 AM.
 
Old 01-08-2016, 11:32 AM   #13
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Smile A small into...

Quote:
I don't understand what this means?
The IPv4 classes (Class A, B, C and D of IPv4)?
Okay, a bit of networking essentials...
Let's say hi to google:
Code:
[melissa@Avalon ~]$ ping www.google.com
PING www.google.com (74.125.136.103) 56(84) bytes of data.
64 bytes from ea-in-f103.1e100.net (74.125.136.103): icmp_seq=1 ttl=46 time=38.0 ms
64 bytes from ea-in-f103.1e100.net (74.125.136.103): icmp_seq=2 ttl=46 time=37.7 ms
64 bytes from ea-in-f103.1e100.net (74.125.136.103): icmp_seq=3 ttl=46 time=37.9 ms
64 bytes from ea-in-f103.1e100.net (74.125.136.103): icmp_seq=4 ttl=46 time=37.9 ms
See the IP address? It is 74.125.136.103. If you were to enter THAT in your browser, you'd end up on ... google .
Now, remembering every IP address is not done...anymore, that's "old skool". That worked when the internet was as big as the handfull of colleges and universities hooked on to it...nowadays DNS does that "translation" for us...
Now, let's Google! In your browser you'd enter www.google.com and underneath...the browser asks the corresponding IP address to the DNS server...and works with that from then on. You never (have to) notice...
But...what do you think will happen when you give an internal server the SAME IP address? Yea, confusion .
IANA came up with a super bril plan: reserve ranges for private use. Now, instead of saying 'my IP adresses starts at 192.168 and go to...." you'd talk about your network as being a Class C...with IP adresses that start at 192.0.0.0 and span aaaaaaalll the way to 223.255.255.255...that is a lot of PC's...
In order to avoid crosstalk, confusion, floods, forrest fires and the odd crying baby...the PURPOSE of the host (the server or PC or printer...) determines what type of IP address it should have...
And, by the looks of it, your servers...have an address reserved for ... public (on the Internet) use....
I added a small example...notice the IP addresses I assigned...all Class C...and..no interference
Neat eh?
Melissa
Attached Thumbnails
Click image for larger version

Name:	LAN01.jpg
Views:	28
Size:	11.6 KB
ID:	20471  
 
2 members found this post helpful.
Old 01-08-2016, 11:39 AM   #14
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,604

Rep: Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960
Quote:
Originally Posted by JockVSJock View Post
Yes and no.

Yes it is coming from a server that is on that closed subnet and I've deleted ron's account (I lock the accounts for 60 to 90 days, to see if anything breaks or if there is anything I need and then I delete the account) on all Linux servers.

No in that the rsyslog is showing ron's public key is trying to connect to two other Linux servers on that closed subnet. Maybe this is some sort of cronjob, that I will have to look at?

Again I searched for all public keys on those servers and can't find anything.
Just speculation here, since I don't know what Ron's job was when he was with your company...but was he a programmer/admin? Could be something as innocuous as a file-transfer for some system that's been dutifully chugging along, and only using Ron's SSH key to SCP a file automatically. Granted, Ron won't be able to actually log in and get a shell...but the KEY is still present, and for SFTP/SCP, it may allow access.

::EDIT:: Re-read the original post. Ron is getting rejected, but the idea of a script somewhere doing something still has weight.

Again, TOTAL SPECULATION...but I'd check both the system and user-specific CRON's on that box

Last edited by TB0ne; 01-08-2016 at 02:39 PM.
 
1 members found this post helpful.
Old 01-08-2016, 03:02 PM   #15
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by TB0ne View Post
Just speculation here, since I don't know what Ron's job was when he was with your company...but was he a programmer/admin? Could be something as innocuous as a file-transfer for some system that's been dutifully chugging along, and only using Ron's SSH key to SCP a file automatically. Granted, Ron won't be able to actually log in and get a shell...but the KEY is still present, and for SFTP/SCP, it may allow access.

::EDIT:: Re-read the original post. Ron is getting rejected, but the idea of a script somewhere doing something still has weight.

Again, TOTAL SPECULATION...but I'd check both the system and user-specific CRON's on that box
Right, I took over Ron's job as a Linux Sys Admin.

Ron didn't leave behind any documentation on servers, programs or scripts. So I'm discovering stuff everyday as I clean up behind Ron. Once I've started the position I locked Ron's account and then 60 days later deleted it. Like I said I'm upgrading from syslog to rsyslog when it showed up and I'm digging into it now.

I'm going to hunt thru the cron jobs and see what I can find, however running the find command for the public key didn't find it.
 
  


Reply

Tags
ssh, sshd, sshd_config, user account


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote login even if user account has been deleted ln00biel Linux - Newbie 3 11-04-2012 05:51 AM
I cant log in to my Linux Mint user account using my user name and password itstraining Linux - Newbie 11 04-26-2012 07:20 PM
"To add a new user account, log in to the root account" how do i do this (im new) pierce77x Linux - Newbie 4 12-28-2008 02:44 PM
Recover files from a Deleted User account cekflores Linux - Newbie 4 03-06-2008 12:15 AM
Can't log into user account nenochka9 Linux - Security 11 01-23-2006 06:33 AM

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

All times are GMT -5. The time now is 01:46 AM.

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