星期五, 一月 09, 2009

RHCE Prerequisites-0109

Shells

Their default environment variables' values are shown in the output to the env command.

echo $PATH

add the /sbin directory to your PATH
PATH=$PATH:/sbin
export PATH

Every time you create a new file, the default permissions are based on the value of umask.
In the past, if the value of umask is 022, the default permissions for any file created by that user is 777-022, but Now 666-022, as new files can no longer get executeable permissions

When you type the umask command, you get a four-number output such as 0245. As of this writing, the first number in the umask output is always 0 and is not used. In the future, this first number may be usable to allow for new files that automatically include the SUID or SGID bits.

SUID and SGID

Shadow Password Suite
Historically, all that was needed to manage Linux users and groups was the information included in the /etc/passwd and /etc/group files. These files included passwords and are by default readable by all users.

The Shadow Password Suite was created to provide an additional layer of protection. It is used to encrypt user and group passwords in shadow files (/etc/ shadow and /etc/gshadow) that are readable only by users with root privileges.

THE Superuser


su The superuser command, su, prompts you for the root password before logging you in with root privileges.

sudo The sudo command allows users listed in /etc/sudoers to run administrative commands. You can configure /etc/sudoers to set limits on the root privileges granted to a specific user.

Red Hat Enterprise Linux provides some features that make working as root somewhat safer. For example, logins using the ftp and telnet commands to remote computers are disabled by default.

/etc/skel for Home Directories
Basic configuration files(hidden) for individual users are available in the /etc/skel directory.
If you want all future users to get specific files in their home directories, include them here.

Red Hat Enterprise Linux provides an easy way to control network service daemons through the scripts in /etc/rc.d/init.d. The actual daemon itself is usually located in the /sbin or /usr/sbin directory.

/etc/init.d/httpd restart

星期四, 一月 08, 2009

RHCE Prerequisites-0108

Architectures
RHCE EXAMS based on the basic Intel 32-bit or i386 architecture


Intel Communications Channels

Three basic channels are used to communicate in a basic PC:
1: interrupt request (IRQ) ports --------/proc/interrupts
An IRQ is a signal that is sent by a peripheral device to the CPU to request processing time.
Normally, each device needs a dedicated IRQ (except for USB and some PCI devices).

2: input/output (I/O) addresses --------/proc/ioports
It's a place where data can wait in line for service from your CPU.

3: direct memory address (DMA) channels --------/proc/dma
A direct memory address (DMA) is normally used to transfer information directly between devices like sound cards which include their own processor, bypassing the CPU.


File Filters
sort, grep, egrep,wc, sed, awk

The wc command, short for word count, can return the number of lines, words, and characters in a file.

The sed command, short for stream editor, allows you to search for and change specified words or even text streams in a file.
sed 's/Windows/Linux/g' opsys > newopsys

The awk command, is more of a database manipulation utility. It can identify lines with a keyword and read out the text from a specified column in that line.
awk '/Mike/ {print $1}' /etc/passwd

星期日, 十一月 30, 2008

tips

1:安装完Ubuntu之后,要能通过putty即ssh访问的话,需要额外安装ssh。
sudu apt-get install openssh-server
2:熟悉的/etc/inittab文件在Ubuntu中,默认不存在,使用基于事件的启动进程upstart代替原来的传统的System V 的 init daemon (Sysvinit),原因在于Sysvinit无法很好地处理现代硬件,如热插拔设备、USB硬盘或山村、网络文件系统等。
cd /usr/share/doc/upstart/
gunzip -c README.Debian.gz
但是Ubuntu仍兼容Sysvinit。
vi /etc/event.d/rc-default 
3:如果想启动直接进入字符界面的话:
sudo apt-get install sysv-rc-conf
sudo sysv-rc-conf
sudo update-rc.d -n -f gdm remove
sudo update-rc.d -n gdm start 2 3 4 5 . stop 0 1 6 .
注意:sysv-rc-conf运行后在选项中寻找到2列 对于的gdm项,去掉选择gdm即可。
当你重新启动ubuntu之后进入了字符界面之后,又想回到图形环境不是用startx命令,而是
telinit 3