Centos帮助手册【不断更新中】
2016-01-09 16:17
495 查看
添加用户
[1] | Add an User "cent" as an example below. |
[root@dlp ~]# useradd cent [root@dlp ~]# passwd cent Changing password for user cent. New UNIX password: # set password Retype new UNIX password: # confirm passwd: all authentication tokens updated successfully. [root@dlp ~]# exit # logout |
[2] | Try to switch to a user that was added above. |
dlp login: cent # input user name password: # password [cent@dlp ~]$ su - # switch to root Password: # root password [root@dlp ~]# # just switched to root |
[3] | Make a user be only a user who can switch to root as an administration user. (it's 'cent' in this example) |
[root@dlp ~]# usermod -G wheel cent [root@dlp ~]# vi /etc/pam.d/su #%PAM-1.0 auth sufficient pam_rootok.so # Uncomment the following line to implicitly trust users in the "wheel" group. #auth sufficient pam_wheel.so trust use_uid # Uncomment the following line to require a user to be in the "wheel" group.# uncomment the following line auth required pam_wheel.so use_uid auth substack system-auth auth include postlogin account sufficient pam_succeed_if.so uid = 0 use_uid quiet account include system-auth password include system-auth session include system-auth session include postlogin session optional pam_xauth.so |
[4] | To forward to emails for root user to another user, set like follows. (it's 'cent' in this example) |
[root@dlp ~]# vi /etc/aliases # Person who should get root's mail # last line: uncomment and change to a user root: cent [root@dlp ~]# newaliases # reload |
防火墙和selinux
[1] | If the Firewall on the server is unnecessarry (for example, because some firewalls are allready running in your LAN ), then stop it like follows. If needs, refer to here to configure Firewalld. |
[root@dlp ~]# systemctl stop firewalld [root@dlp ~]# systemctl disable firewalld rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service' rm '/etc/systemd/system/basic.target.wants/firewalld.service' |
SELinux |
[2] | If you'd like to disable SELinux (Security-Enhanced Linux), configure like follows. |
[root@dlp ~]# vi /etc/selinux/config# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded.SELINUX= disabled # change # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted[root@dlp ~]# reboot # reboot |
查看进程id
pgrep java查看进程使用的环境变量
格式化显示:
cat /proc/25401/environ | tr '\0' '\n'查看当前使用的shell类型
echo $SHELL或者
echo $0
查看当前用户是否是root用户
root用户的uid是0
相关文章推荐
- (转)linux c多线程编程
- Linux下配置Lamp
- Linux下配置Lamp
- 树莓派安装和配置kali-linux-2.0
- Linux-CentOS7学习2_设置IP地址
- linux调试工具GDB
- 通用C 链表(linux思想)
- Linux下最快速共享目录的方法
- Linux平台下线程池的原理及实现
- linux信号
- linux下IPTABLES配置详解
- linux下基于rsync + find命令实现文件同步机制
- debian系统的vps 初步配置
- linux下创建eclipse桌面快捷方式
- linux常用命令技巧--更新中
- linux 手工添加用户
- Linux 分布式复制块设备之DRBD
- linux ssh 免密码登录
- 如何在Linux中查看占用空间大文件和大文件夹
- imx6ulevk linux内核usb驱动的问题