LinuxQuestions.org
Review your favorite Linux distribution.
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 10-16-2023, 01:00 PM   #1
HytronBG
LQ Newbie
 
Registered: Oct 2023
Posts: 10

Rep: Reputation: 0
Angry Cannot disable root login / Slackware Linux 15.0


Hi!

I have been using Slackware Linux since 90s and never seen this issue before. But something has changed with Slackware Linux 15.0

Back in the days (Even the previous Slackware 14.2), you would comment out all the ttys in /etc/securetty to disallow direct root login. But my currect /etc/securetty looks like this:

console
tty0
tty1
tty2
tty3

...and I am still able to login to the machine by telneting to it.

Does anyone know how to fix this? This is obviously a HUGE security risk that was not addressed before Slackware 15.0 was released. Slackware 15.0 was the first version to introduce PAM, and no matter what I add to the /etc/pam.d/login file I am still able to login directly to the root account using telnet. Does anyone have any idea?

(I typically login using telnet to my username and then from there if I need root access I would use: su - )

https://www.linuxquestions.org/quest...s_lq/icon8.gif

TIA!

Last edited by HytronBG; 10-16-2023 at 01:44 PM.
 
Old 10-16-2023, 03:21 PM   #2
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,849

Rep: Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519
Code:
cp /etc/pam.d/login /etc/pam.d/remote
But you know that telnet has no security, don't you?
 
2 members found this post helpful.
Old 10-16-2023, 04:44 PM   #3
HytronBG
LQ Newbie
 
Registered: Oct 2023
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Petri Kaukasoina View Post
Code:
cp /etc/pam.d/login /etc/pam.d/remote
But you know that telnet has no security, don't you?
Yes I know, it is used on a local network only with no other users.
 
Old 10-16-2023, 11:22 PM   #4
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,849

Rep: Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519Reputation: 1519
So, was the problem solved when you tried the correct PAM config file name /etc/pam.d/remote ?
 
1 members found this post helpful.
Old 10-17-2023, 07:14 AM   #5
HytronBG
LQ Newbie
 
Registered: Oct 2023
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Petri Kaukasoina View Post
So, was the problem solved when you tried the correct PAM config file name /etc/pam.d/remote ?
Thats it!! My distribution did not come with the file /etc/pam.d/remote. Not sure why! I kept messing around with /etc/pam.d/login but had no effect! As soon as you mentioned the remote file I copied the content of /etc/pam.d/login (as you mentioned) and here we go! It works!

Just to add...I had no previous experience with PAM. This was the first distribution of Slackware that came with PAM enabled and installed.

Thanks again for your input!! It helped alot!

Darko

Last edited by HytronBG; 10-17-2023 at 07:17 AM.
 
Old 10-17-2023, 01:07 PM   #6
glennmcc
Member
 
Registered: Jan 2021
Location: North Jackson, Ohio (USA)
Distribution: slackware64-15.0
Posts: 556

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Uuummm....

As you point out, you only use telnet locally.

So, to prevent such a really bad security risk from the WAN...
close port 23 on your router so that telnet can _only_ be used on the LAN

Here on my router, the _only_ port that is open to the WAN is 80 for httpd
all other ports such as 21, 22, 23, etc...etc.. are closed to the WAN
so that their services can only be used on the LAN

BTW, a much better method for accessing machines within the LAN is ssh instead of telnet
and of-course, rsync works great for transferring files between machines on the LAN

Last edited by glennmcc; 10-17-2023 at 02:16 PM.
 
2 members found this post helpful.
Old 10-17-2023, 03:07 PM   #7
metaed
Member
 
Registered: Apr 2022
Location: US
Distribution: Slackware64 15.0
Posts: 371

Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by HytronBG View Post
it is used on a local network only with no other users
Hopefully an isolated network. Otherwise, the intruder who compromises any device on the local network can mine your TELNET packets for plaintext passwords, replay them, and become root on your system.
 
1 members found this post helpful.
Old 10-18-2023, 09:29 AM   #8
HytronBG
LQ Newbie
 
Registered: Oct 2023
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by glennmcc View Post
Uuummm....

As you point out, you only use telnet locally.

So, to prevent such a really bad security risk from the WAN...
close port 23 on your router so that telnet can _only_ be used on the LAN

Here on my router, the _only_ port that is open to the WAN is 80 for httpd
all other ports such as 21, 22, 23, etc...etc.. are closed to the WAN
so that their services can only be used on the LAN

BTW, a much better method for accessing machines within the LAN is ssh instead of telnet
and of-course, rsync works great for transferring files between machines on the LAN
I have ports 21 through 23 all blocked on my Cisco firewall. SSH is available just on a different high random port that I assigned. When I had ssh on a standard port 22, there were soooo many attempts and they were continuous! These bots or people just dont give up!

As far as telnet goes..yeah its just a quick way for me to hope from switch to local machines (You can probably tell I have used linux since 90s haha), but yes telnet and all unencrypted traffic is closed on my Cisco firewall (Except port 80 for the http).
 
Old 10-18-2023, 09:31 AM   #9
HytronBG
LQ Newbie
 
Registered: Oct 2023
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by metaed View Post
Hopefully an isolated network. Otherwise, the intruder who compromises any device on the local network can mine your TELNET packets for plaintext passwords, replay them, and become root on your system.
Yeah its a bit isolated on my second segment of my router...but yes you are right!
 
Old 10-18-2023, 01:22 PM   #10
metaed
Member
 
Registered: Apr 2022
Location: US
Distribution: Slackware64 15.0
Posts: 371

Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by HytronBG View Post
its a bit isolated on my second segment of my router...but yes you are right
I have a soft spot in my heart for early protocols, but in your shoes I would switch to ssh instead of taking the risk.
 
  


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
LXer: Disable SSH root Login And Permit The root User Via su User In Linux LXer Syndicated Linux News 0 04-14-2019 07:28 AM
how to disable "last login log" & disable "last login message" when start login. hocheetiong Linux - Newbie 4 02-08-2011 05:35 AM
Cannot disable root login, Gentoo matt123 Linux - Security 3 11-10-2009 04:48 AM
I have re-installed MK 9.2 but cannot login as user, login as root works. bobinglis Mandriva 2 02-22-2004 11:39 AM

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

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