linux操作备忘录

c/c++ Python perl bash postgres
ipc socket make gdb ld ldd objdump
cluster distributed

procinfo oprofile(hard to install) lsof
sysstat: sar iostat mpstat vmstat
mii-tool ifconfig iptraf(curses) gkrellm(gui) netstat etherape
gnumeric(gnome spreadsheet)


ldap vpn dhcp dns sendmail pam iptables

PAM conf line: service, module type, control flag, module path, options
module type: auth, account, session, password
control flag: required, requisite, optional, sufficient

# find the name of your neighbors
( for((i=1;i<255;i++));do echo -n 192.168.0.$i " ";ipcalc -h 192.168.0.$i 2>&1;done ) | grep -v cannot
# generate a key, add -des3 to encrypt it
openssl genrsa 1024 > testserver.key
# if -des3 and want to remove the passphrase
openssl rsa -in testserver.key.old -out testserver.key
# generate a CSR from the key to be signed, will prompt for many questions
openssl req -new -key testserver.key > testserver.csr
# self-signed certificate from the key and csr
openssl req -x509 -key testserver.key -in testserver.csr > testserver.crt
cat testserver.key > /etc/httpd/conf/ssl/ssl.key
cat testserver.csr > /etc/httpd/conf/ssl/ssl.csr
cat testserver.crt > /etc/httpd/conf/ssl/ssl.crt



runlevel:
0 halt
1 single
2-5 verdor defined
6 reboot
halt, reboot, and poweroff will launch shutdown with appropriate parameters if the system is in runlevel 2-5

1) Sticky bit was used on executables in linux (which was used more often)so that they would remain in the memory more time after the initial execution, hoping they would be needed in the near future. But since today we have more sophisticated memory accessing techniques and the bottleneck related to primary memory is diminishing, the sticky bit is not used today for this. Instead, it is used on folders, to imply that a file or folder created inside a stickybit-enabled folder could only be deleted by the creator itself. A nice implementation of sticky bit is the /tmp folder,where every user has write permission but only users who own a file can delete them. Remember files inside a folder which has write permission can be deleted even if the file doesn't have write permission. The sticky bit comes useful here.

2) As of SUID or SetUID bit, the executable which has the SUID set runs with the ownership of the program owner. That is, if you own an executable, and another person issues the executable, then it runs with your permission and not his. The default is that a program runs with the ownership of the person executing the binary.

3) The SGID bit is the same as of SUID, only the case is that it runs with the permission of the group. Another use is it can be set on folders,making nay files or folders created inside the SGID set folder to have a common group ownership.

T,t: sticky, t for mm7 and T for mm6 or lower where mm is any digit between 0-6
s: in position of x, suid or sgid
X: execute  only if the file is a directory or already has execute permission for some user

The permissions on a directory are the same as those used by files: read, write, and execute. The actual permissions, however, mean different things. For a directory, read access provides the capability to list the names of the files in the directory but does not allow the other attributes to be seen (owner, group, size, and so on). Write access provides the capability to alter the directory contents. This means the user could create and delete files in the directory. Finally, the execute access enables the user to make the directory the current directory.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值