首页 | Linux 基础 | 资讯动态 | Linux 应用 | Linux 服务器 | Linux 开发 | Linux 安全 | 专题 | 联盟论坛
  当前位置:主页>Linux 应用>linux技巧应用>文章内容
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条)] [返回顶部] [打印本页] [关闭窗口]  
  热点文章
·MBR如果被覆盖了怎麽办?
·Linux操作系统Gaim玩转QQ与MSN--
·shell编程技巧
·制作软盘上运行的FreeBSD系统
·简述 Linux 文件系统的目录结构
·提高Linux系统性能,加速网络应用
·优化Linux系统服务器硬盘实用技
·Linux操作系统下设置NFS共享讲解
·Linux 的带宽管理系统
·通过Linux系统引导CD排除服务器
·Linux系统下查CPU个数的方法
·精彩分享:Linux系统下使用aMsn
  相关文章
·打造自己的Linux 常用应用软件列
·Linux下文件的压缩、打包与解开
·MBR如果被覆盖了怎麽办?
·Linux下计算程序运行时间的两种
·Linux 运行级init详解(新手遍)
·使用 ssh 进行安全的连接
·shell编程技巧
·linux操作系统修改共享内存的简
·Linux系统在存储技术中的几项应
·简述 Linux 文件系统的目录结构
·怎样才能提高Linux系统安全性能
·Linux 的带宽管理系统

本站信息源至:互联网络,均为学习,交流所用,如有版权问题,请联系我们.
站长QQ:397422079 E_mail:riechelr_hl@unix5.com
转载本站内容请注明原作者名.谢谢!