Notes by voodoo
Displaying notes 41 - 50
Created by voodoo on June 05, 2011 20:10:38
Last update: June 05, 2011 20:10:52
Use apt-get to install openssh sshd on Ubuntu:
sudo apt-get install openssh-server
Created by voodoo on May 02, 2011 14:11:42
Last update: May 02, 2011 14:11:58
This is a howto about scanning emails for viruses on Ubuntu with ClamAV:
How would I go about scanning my email for viruses and other nasties?
Created by voodoo on April 14, 2011 13:48:29
Last update: April 14, 2011 13:49:29
The SELinux security context for files is stored in the form of an extended file attribute.
To remove security context in a file:
setfattr -x security.selinux file_name
But you have to boot with SELinux disabled before you can do that.
To restore security context in a file:
restorecon -v file_name
Created by voodoo on April 14, 2011 13:16:18
Last update: April 14, 2011 13:17:48
From Fedora Project wiki : A security context , or security label , is the mechanism used by SELinux to classify resources, such as processes and files, on a SELinux-enabled system. This context allows SELinux to enforce rules for how and by whom a given resource should be accessed. A security context is typically shown as a string consisting of three or four words. Each word specifies a different component of the security context, namely, the user , role , type , and level of that file or process . Each word is separated by a colon. Use the -Z switch to display security context info. Display security context for Apache files:
$ ls -Z /var/www/ drwxr-xr-x. root root system_... Display security for files under...
Created by voodoo on March 04, 2011 12:11:33
Last update: April 13, 2011 13:55:13
By default SELinux blocks execstack permission. According to Ulrich Drepper :
"As the name suggests, this error is raised if a program tries to make its stack (or parts thereof) executable with an mprotect call. This should never, ever be necessary. Stack memory is not executable on most OSes these days and this won't change. Executable stack memory is one of the biggest security problems. An execstack error might in fact be most likely raised by malicious code."
You can check if a library/application requires execstack by using the execstack utility:
execstack -q PATHTOPROGRAM
You can try to clean the flag and see if the application still runs:
execstack -c PATHTOPROGRAM
To allow execstack for cc1 :
# grep cc1 /var/log/audit/audit.log | audit2allow ...
Created by voodoo on April 13, 2011 13:47:34
Last update: April 13, 2011 13:49:20
You get "permission denied" error from Apache HTTPD for a page. And you checked file/directory permissions (the whole directory path, not just the file) and everything in httpd.conf . If everything seemed right, then SELinux may be blocking the access.
Open /var/log/httpd/error_log , you may see a line like this:
[Wed Apr 13 15:50:35 2011] [notice] SELinux poli...
These are the steps to fix:
If the directory resides in a user home directory:
# setsebool -P httpd_read_user_content 1
Create a policy package from the audit log:
# grep httpd /var/log/audit/audit.log | audit2allo...
Apply the policy package just created
# semodule -i mypol.pp
Restart apache httpd:
# apachectl restart
Created by voodoo on April 13, 2011 13:14:03
Last update: April 13, 2011 13:14:03
Normally an icon displays automatically in the status area (upper right corner) when an AVC denial happens. But in case you need to bring up the SELinux alter browser manually, here's the command:
$ sealert -b
Created by voodoo on April 13, 2011 12:50:16
Last update: April 13, 2011 12:50:16
You can check SELinux status by /usr/sbin/sestatus :
$ /usr/sbin/sestatus
SELinux status: ...
SELinux audit log is available from: /var/log/audit/audit.log
Created by voodoo on November 24, 2010 23:21:00
Last update: March 31, 2011 08:59:05
PostgreSQL jdbc connection string: jdbc:postgresql://<hostname>:<port>/<database_name> .
Example code:
// register JDBC driver with DriverManager
Clas...
Created by voodoo on March 24, 2011 11:20:00
Last update: March 24, 2011 11:23:47
Sometimes you want to disable the UAC because a program written for XP doesn't have the notion of UAC. When running such a program under Windows 7, it silently denies your preference changes.
Enter Control Panel, goto User (Account) Manager.
Click the link "Change User Account Control Settings".
Move the slider to the bottom