Linux学习笔记

Linux Summary

Login shell

Login shell执行顺序:

/etc/profile

       /etc/profile.d

       ~/.bash_profile

       ~/.bashrc

       /etc/bashrc

 

Non-login shell执行顺序:

~/.bashrc

       /etc/bashrc

       /etc/profile.d

 

杂项

chown luther test.c    //改变test.c文件所属用户为luther

chgrp root test.c      //改变test.c文件所属用户组为root

chown luther:root test.c //使用一条命令改变test.c文件为luther用户和root用户组

chown luther:luther luther_dir -R //递归改变luther_dir目录.

 

修改IP地址: /etc/sysconfig/network-scripts/ifcfg-eth0

配置网关:    /etc/resolv.conf

 

端口号与映射的服务存放在 /etc/services

修改默认的运行模式          /etc/inittab

 

Linux的启动服务一般放在两个文件中, /etc/init.d/etc/xinetd.d文件夹中,前者可以通过脚本关闭,后者必须修改配置文件之后重启xinetd才能关闭。

 

IPC

MSGMNB : 每个消息队列的最大字节限制。

MSGMNI : 整个系统的最大数量的消息队列。

MSGGSZ : 消息片断的大小(字节)。大于该值的消息被分割成多个片断。

 

MSGSEG : 在单个队列里能存在的最大数量的消息片断。

MSGTQL : 整个系统的最大数量的消息。

MSGMAX : 单个消息的最大size。在某些操作系统例如BSD中,你不必设置这个。BSD自动设置它为MSGSSZ * MSGSEG。其他操作系统中,你也许需要改变这个参数的默认值,你可以设置它与MSGMNB相同。

SHMSEG : 每个进程的最大数量的共享内存片断。

SHMMNI : 共享内存片断数量的系统级的限制。

SHMMAX : 单个共享内存片断的最大size

SHMALL : 可分配的共享内存数量的系统级限制。在某些系统上,SHMALL可能表示成页数量,而不是字节数量。

 

可以通过修改配置文件/etc/sysctl.conf,调整系统IPC资源

 

FD

一个进程启动时,都会打开 3 个文件:标准输入、标准输出和标准出错处理。这3 个文件分别对应文件描述符为 012也就是宏替换 STDIN_FILENOSTDOUT_FILENOSTDERR_FILENO,鼓励读者使用这些宏替换)

可以如下查看LINUX默认的文件描述符,总共有1024个,对于大多数情况下是够用的:

# ulimit –n 1024

 

要增大这个值,最正确的做法是在/etc/security/limits.conf里设置:

* hard nofile 65535
* soft nofile 65535

 

What is PAM for Unix?

In 1995, the Open Software Foundation (now the Open Group) published a Request for Comments (RFC) to address the issue of Pluggable Authentication Modules (PAM). This RFC sparked a great deal of interest and lead to the development of PAM for a variety of platforms.

 

PAM applies an additional layer of abstraction to Unix authentication. Applications communicate an authentication request to PAM. PAM then performs the actual authentication through a variety of means, and returns a response to the application. With this mechanism, any changes to the authentication scheme on a particular system require that the system administrator apply the changes to PAM instead of directly to each individual application.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值