Sunday 29 November 2009

Attach a projector to Xubuntu with Nvidia cards

The other day I faced a problem just before my talk in the first meeting of R users in Spain: I could not project to the big screen. The usual Settings > Display menu was of no help.

What you need to do is to run

sudo nvidia-settings

in your terminal and then go to X Server Display Configuration.

There, after pluging in the video cable for the projector, you should click on the Detect Displays button for the video card to detect the new screen. The Configuration: Separate X Screen button allows you to decide where to project your X, locally, on the projector or in both displays.

Tuesday 17 November 2009

Restrict ssh access to Linux server to members of a group

You may want to restrict ssh access to a server to members of a group. I faced this problem when I only wanted members in the "consultants" group to be able to log into our CentOS server.

In order to achieve this, you need only edit the file sshd_config (in CentOS, it is located in /etc/ssh, but this may be distribution-dependent) and add the following line to it:

AllowGroups consultants

Mind that this line, contrary to intuition, does not grant members of the "consultants" group the right to log in, but restricts this right to any other member in any other group. So, perhaps you may want to use

AllowGroups consultants root

instead so as to allow root logins (just in case).