Saturday, June 28, 2008

Processor support for 64 bit?

While chatting with a friend online the other day I became curious how one would determine if a processor supports 64bit and if the kernel is 64bits. Know the answer to first question could have helped me out a few weeks ago when I tried to install the x86_64 version of Fedora 9 on my wife's laptop. Unfortunately when I booted the install disk, the installer message stated that it was not 64bit capable.

To determine if you processor supports 64bit mode in Linux, the easiest thing to do is:
grep lm /proc/cpuinfo

The lm stands for long mode and it's in the cpu flags section. If more than one line is returned with the same information, the processor has multiple cores.

To determine if the OS kernel what instruction set it is running use:
uname -m

A value of x86_64 indicates that it is running the 64 bit extensions for Intel/AMD.

Thursday, June 26, 2008

Could not chdir to home directory /home/xxx

I recently installed Fedora 9 x86_64 on my home machine. This is the first time that I've run the 64 bit version. I didn't disable SELinux this time either.

I've got most things working well on the machine. The most annoying issue that I've had is when I used ssh to access my machine from somewhere else. Everytime that I logged in I would get the the following message and get dumped to the / directory.

Could not chdir to home directory /home/xxx: Permission denied

I could type cd and it would take me to my home directory. I could read files in those directories. Looking around I found that others were having problems but usually it was a pam problem or something else related to authentication. Eventually I decided that it was a SELinux issue.

Since I've never run SELinux on my machine, it stands to reason that none of the proper contexts were ever applied to the home directories. After digging around with google and figuring out what I needed I discovered the problem. Below is what my context looked like:

> ls -Zd *
drwx------ xxx xxx system_u:object_r:file_t:s0 xxx

I created another user and discovered that what it should look like is this:

drwx------ aaa aaa system_u:object_r:user_home_dir_t:s0 aaa

To change the context to be that I used:

>chcon -t user_home_dir_t xxx
> ls -Zd *
drwx------ xxx xxx system_u:object_r:file_t:s0 xxx

SELinux tended to be difficult to use. Fedora and the other distributions are working hard to make it easier to use. Consider leaving it enabled when working with newer distributions. It could prevent a zero day exploit from taking over your machine.