centos7用户权限设置
2014-12-08 15:48
141 查看
1、 sudo权限添加,编辑修改/etc/sudoers配置文件,在root ALL=(ALL) ALL下,添加要加sudo权限的账号。
2、改ssh远程端口:编辑vi
/etc/ssh/sshd_config,找到#Port
22一段,修改为如下:Port 22 ,把Port后的22改成 你要改的端口号(比如8080),然后保存退出,重启sshd服务(systemctl
restart sshd.service)。再在 etc/sysconfig/iptables,中把原来的端口22,改成sshd_config中port的端口号,保存重启iptables服务 (systemctl restart iptables.service)。
3、为了安全,不让root用远程方式登陆系统,编辑#vi /etc/ssh/sshd_config,找到PermitRootLogin
yes,改为 PermitRootLogin no,保存退出,重启sshd服务(systemctl
restart sshd.service)。
4、限制非wheel组用户,不能使用su命令。
编辑/etc/pam.d/su文件,添加auth required /usr/lib64/security/pam_wheel.so use_uid
auth sufficient /usr/lib64/security/pam_rootok.so debug
auth required /usr/lib64/security/pam_wheel.so group=wheel
(说明:这三个文件的路径是centos7下的,其他版本请自行查找),
修改/etc/login.defs文件,在最后添加SU_WHEEL_ONLY yes。
将新添加的普通用户添加的wheel组中,命令usermod -G wheel 用户名。
2、改ssh远程端口:编辑vi
/etc/ssh/sshd_config,找到#Port
22一段,修改为如下:Port 22 ,把Port后的22改成 你要改的端口号(比如8080),然后保存退出,重启sshd服务(systemctl
restart sshd.service)。再在 etc/sysconfig/iptables,中把原来的端口22,改成sshd_config中port的端口号,保存重启iptables服务 (systemctl restart iptables.service)。
3、为了安全,不让root用远程方式登陆系统,编辑#vi /etc/ssh/sshd_config,找到PermitRootLogin
yes,改为 PermitRootLogin no,保存退出,重启sshd服务(systemctl
restart sshd.service)。
4、限制非wheel组用户,不能使用su命令。
编辑/etc/pam.d/su文件,添加auth required /usr/lib64/security/pam_wheel.so use_uid
auth sufficient /usr/lib64/security/pam_rootok.so debug
auth required /usr/lib64/security/pam_wheel.so group=wheel
(说明:这三个文件的路径是centos7下的,其他版本请自行查找),
修改/etc/login.defs文件,在最后添加SU_WHEEL_ONLY yes。
将新添加的普通用户添加的wheel组中,命令usermod -G wheel 用户名。
相关文章推荐
- centos普通用户设置sudo权限
- centos(linux)普通用户设置sudo权限
- centos添加普通用户,操作权限设置
- Centos 5.5下SFTP用户权限设置
- Centos下普通用户设置sudo权限
- centos添加普通用户,操作权限设置
- CentOS系统为normal用户设置sudo权限
- CentOS 普通用户设置sudo权限
- centos普通用户设置sudo权限
- Centos下普通用户设置sudo权限
- Centos7 添加用户及设置权限
- CentOS7 添加FTP用户并设置权限
- CentOS7 添加FTP用户并设置权限
- centos将普通用户设置sudo权限
- CentOS 普通用户设置sudo权限
- centos下svn 安装配置,及用户权限设置
- centos普通用户设置sudo权限
- Centos7 添加用户及设置权限
- centos 6.x 7.x 批量添加用户 开启sudo 权限 并设置密匙登录
- 经验共享:事件查看器——权限设置未将COM 服务器应用程序(CLSID 为{F32DF1E7-2282-11D3-9FA5-00C04F6BC724})的本地激活权限授予用户ArcGISSOC