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 09-19-2004, 02:46 PM   #1
Obie
Member
 
Registered: Apr 2004
Distribution: Red Hat
Posts: 290

Rep: Reputation: 30
Question X Windows


Hi,

I was wondering how I could restrict XDM to the console in a server environment and only allow a user to login either physically at the machine or via SSH?

Thanks
 
Old 09-20-2004, 04:50 PM   #2
Obie
Member
 
Registered: Apr 2004
Distribution: Red Hat
Posts: 290

Original Poster
Rep: Reputation: 30
Anyone at all?
 
Old 09-20-2004, 06:27 PM   #3
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
I was wondering how I could restrict XDM to the console in a server environment
Not really sure what you mean by that, but if you're asking how do you block remote X sessions, you can firewall the Xserver ports and then make sure that X11Forwarding is disallowed in the sshd config. If you're really setting up a production server environ. it really shouldn't even have X/XDM installed anyway.

and only allow a user to login either physically at the machine or via SSH?
Removing any other remote login applications (telnetd, etc) except ssh would work. You can even configure your firewall to only allow incoming ssh traffic. I'd imagine you could probably use PAM as well (it can do just about anything).
 
Old 09-20-2004, 08:52 PM   #4
Obie
Member
 
Registered: Apr 2004
Distribution: Red Hat
Posts: 290

Original Poster
Rep: Reputation: 30
I was wondering how I could restrict XDM to the console in a server environment
Not really sure what you mean by that, but if you're asking how do you block remote X sessions, you can firewall the Xserver ports and then make sure that X11Forwarding is disallowed in the sshd config. If you're really setting up a production server environ. it really shouldn't even have X/XDM installed anyway.

>> Capt_Caveman, what I meant is to only allow physical access to the system and disable all remote acccess. The only reason I wish to install XDM is that in the event that someone who is not so familar with the CLI can make basic changes if required. Is there anything I need to be aware to harden XDM and the server?
Thank you.
 
Old 09-20-2004, 09:42 PM   #5
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Blocking acess to the Xserver ports, editing the /etc/X11/xdm/Xservers file and adding -nolisten tcp to the following line:

:0 local /usr/X11R6/bin/X

In general try to reduce the number of KDE and Gnome software that is installed. You don't need stuff like camera apps or GIMP on there and they simply provide more ways someone can perform a priviledge elevation attack. Also try to avoid running X as root as much as possible. That should help, but you should really focus on overall system and kernel hardening first.
 
Old 09-21-2004, 03:23 PM   #6
Obie
Member
 
Registered: Apr 2004
Distribution: Red Hat
Posts: 290

Original Poster
Rep: Reputation: 30
Blocking acess to the Xserver ports, editing the /etc/X11/xdm/Xservers file and adding -nolisten tcp to the following line:
:0 local /usr/X11R6/bin/X

>> Capt_Caveman, thank you. Is it possible to add the line as noted below to block all packets including udp.
:0 local /usr/X11R6/bin/X -nolisten all
 
Old 09-22-2004, 08:26 PM   #7
Obie
Member
 
Registered: Apr 2004
Distribution: Red Hat
Posts: 290

Original Poster
Rep: Reputation: 30
Capt_Caveman,

Would my previous post be correct about dropping all incoming packets?
 
Old 09-22-2004, 10:29 PM   #8
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
X will only open a tcp port for connections by default. You can test this very easily by: starting at console w/o an Xsession and type netstat -a, then start X and do the same thing. You'll notice a tcp port is opened on port 6000. You'll also see a number of internal Unix sockets established as well, though these are only accessible locally for things like connecting to the font server.

X does use udp under certain circumstances (XDMCP), however it doesn't listen for udp packets under normal circumstances. So if anyone were to send a udp packet to your machine, it would be ignored. That being said, if your system is exposed to the internet, then you should be firewalling any ports that you don't need to be remotely accessible.
 
  


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
Linux under Windows - to use USB devices, not affect / reboot Windows, etc? pianoplayer88key General 2 12-01-2005 07:17 PM
Red Hat Linux 9 + Windows Server 2003 + Windows XP + Fedora in same domain wolfy339 Linux - Networking 5 03-02-2005 06:03 AM
SuSE 9.1 and Windows Xp refuse to live in harmony: error loading windows through GRUB sanctumtacete Linux - Newbie 3 10-19-2004 07:47 AM
Running Windows Games In Linux From Windows Hard Drive Darkstar274 Linux - Games 2 12-25-2003 11:19 PM
Partitioning drives to split Linux and windows with windows already on computer. linuxnoub Linux - Hardware 5 10-16-2003 12:21 AM

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

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