|
linux应用技巧集囊(新手遍)
|
|
来源:www.unix5.com 作者:riechelr_hl 发布时间:2007-05-29
|
|
and append the content of identity.pub file to your authorized_keys file now, in your machine, type $ ssh -l username your_remote_machine.domain.com Boom, no password, no headache, you're in the other side...;)
Blocking anyone to su to root by Ismail YENIGUL , homepage: http://apache.cslab.itu.edu.tr ==================================== The su (Substitute User) command allows you to become other existing users on the system. For example you can temporarily become "root" and execute commands as the super-user "root". If you don't want anyone to su to root or restrict "su" command to certain users then add the following two lines to the top of your "su" configuration file in the "/etc/pam.d/" directory. 1- Edit the su file (vi /etc/pam.d/su) and add the following two lines to the top of the file: auth sufficient /lib/security/pam_rootok.so debug auth required /lib/security/pam_wheel.so group=wheel After adding the two lines above, the "/etc/pam.d/su" file should look like this: #%PAM-1.0 auth sufficient /lib/security/pam_rootok.so debug auth required /lib/security/pam_wheel.so group=wheel auth required /lib/security/pam_pwdb.so shadow nullok account required /lib/security/pam_pwdb.so password required /lib/security/pam_cracklib.so password required /lib/security/pam_pwdb.so shadow use_authtok nullok session required /lib/security/pam_pwdb.so session optional /lib/security/pam_xauth.so Which means only those who are a member of the "wheel" group can su to root; and to add a user to wheel group use: root# usermod -G10 username Ok, now everybody can not be root using su. When an user that is not in wheel group runs su command ,he/she can not be root even if he/she writes correct root password.
Disable reboot,halt ,shutdown for users by Ismail YENIGUL , homepage: http://apache.cslab.itu.edu.tr ==================================== On Redhat [root@apache /]# rm -f /etc/security/console.apps/halt [root@apache /]# rm -f /etc/security/console.apps/poweroff [root@apache /]# rm -f /etc/security/console.apps/reboot [root@apache /]# rm -f /etc/security/console.apps/shutdown [root@apache /]# rm -f /etc/security/console.apps/xserver (if removed, root will be the only user able to start x).
How to create many subdirectories in one time by Pascal Mulier ==================================== Sometimes, we want to create 2 or 3 (or more) directories at the same time. For example, you are in "rep1" directory ("rep1" doesn't contain any subdirectory) and want to create rep1/rep2/rep3 With "p" option of the mkdir command , it's very easy : mkdir -p rep1/rep2/rep3
How to delete all files from /tmp? ==================================== Simple question? Well, how do you delete files in directories that start with a dot in the name? Rm -r /tmp/.* WILL DELETE THE WHOLE DISK as it selects also the file /tmp/.. Therefore never try this. The solution is to add two question marks before the '*'-wildcard: rm -rf /tmp/.??* /tmp/* You can put this into /etc/rc.d/init.d/syslog into the "stop)" section. This will clean up /tmp at every shutdown and keep your disk tidy. Do not run the above command while running X11 or before you run startx. X11 needs the /tmp/.font-unix which is created by xfont server and X11 it self creates the directory /tmp/.X11-unix which is needed to talk to the X11 windows.
共9页: 上一页 [1] [2] [3] [4] [5] [6] [7] [8] 9 下一页
|
| |
|
|
如果您对本文有任何疑问或者建议,请到论坛讨论区发表您的意见: >> 论坛入口 |
[ 收藏]
[ 推荐]
[ 评论(0条)]
[返回顶部] [打印本页]
[关闭窗口] |
|
|
|