pam

centos 6.8下制作openssh8.1rpm包并升级

佐手、 提交于 2019-12-04 06:34:35
今天在工作上遇到一个问题,在做安全扫描的时候发现,openssh有比较多的漏洞,按照绿盟扫描器的建议需要升级到最新版本。但是生产环境升级的时候会遇到很多的问题,所以决定在测试环境下打成rpm包上传到生产环境下进行升级。 备份 在做所有的变更都要备份,如果有问题可以随时回滚。 mkdir /opensshbackup cd /opensshbackup mkdir -p /opensshbackup/ssh mkdir -p /opensshbackup/binssh mkdir -p /opensshbackup/sbinssh cp /etc/ssh/* /opensshbackup/ssh cp /etc/pam.d/sshd . cp /usr/bin/ssh* /opensshbackup/binssh cp /usr/sbin/ssh* /opensshbackup/sbinssh 安装基础依赖 yum install rpm-build zlib-devel openssl-devel gcc perl-devel pam-devel unzip wget -y 使用rpmbuild进行构建 解压包 tar xvf openssh-8.1p1.tar.gz cd openssh-8.1p1 创建一个目录SOURCES mkdir SOURCES cd SOURCES

Linux_FHS目录作用分析

核能气质少年 提交于 2019-12-03 23:54:22
总目录概览 目录 英文全名 用途 /bin Binaries 用于存放最常用的二进制命令 /boot Boot 包含引导Linux的重要文件,如grub和内核文件等 /dev Devices 所有设备都在该目录下,包括硬盘和显示器等 /etc etc 系统的所有配置文件都放在它下面 /home Home 存放个用户的家目录($HOME)及其文件和配置 /lib Libraries 系统的库文件,有点像Windows的Program Files /lost+found lost+found 用于存放系统异常时丢失的文件(如突然宕机),以利于恢复 /media Media 用于加载各种媒体,如光盘、软盘等 /mnt Mount 用于加载各种文件系统 /opt Optionally 用于存放安装的“可选”程序 /proc Processes 包含进程等信息,是内存的映射,不是真实目录 /root Root 该目录是root用户的家目录($HOME) /run Run 该目录是是系统每次重启时生成的tmpfs,其真正的链接是/var/run /sbin System-only binaries 用于存放系统专用的二进制命令 /srv Service 服务启动之后需要访问的数据目录 /sys System 用于存放系统信息 /tmp Temporary files 用于存放临时文件 /usr

Security concerns with a Python PAM module?

霸气de小男生 提交于 2019-12-03 11:40:48
I'm interested in writing a PAM module that would make use of a popular authentication mechanism for Unix logins. Most of my past programming experience has been in Python, and the system I'm interacting with already has a Python API. I googled around and found pam_python , which allows PAM modules to invoke the python intrepreter, therefore allowing PAM modules to be written essentially in Python. However, I've read that there are security risks when allowing a user to invoke Python code that runs with a higher access level than the user itself, such as SUID Python scripts. Are these concerns

PHP/PAM to change user password?

廉价感情. 提交于 2019-12-03 08:07:46
Are there any working packages to change a linux user passwords using PHP? I've tried using PECL:PAM but theres an error when it tries to change the password. Edit: PHP code: echo pam_chpass($username, $password, $new_pass, &$error) ? 'good' : $error; PHP (echo) output: Permission denied (in pam_authenticate) From /var/log/auth (these are actually from before, the log doesn't seem to be working ATM for some reason yet to be determined): Jun 11 15:30:20 veda php: pam_unix(php:chauthtok): conversation failed Jun 11 15:30:20 veda php: pam_unix(php:chauthtok): password - (old) token not obtained

Ubuntu16.04搭建FTP服务器

巧了我就是萌 提交于 2019-12-02 07:39:18
搞了下FTP服务器,基本上能遇到的问题都遇到了-。-! 先说步骤: 1.安装vsftpd软件包 sudo apt-get install vsftpd 2.打开配置文件 vim /etc/vsftpd.conf 3.修改参数 一些参数可以去掉注释激活,为了方便,你也可以注释全部,然后添加下面的设置 #这些设置系统默认是开启的,可以不管 listen = NO listen_ipv6 = YES dirmessage_enable = YES use_localtime = YES xferlog_enable = YES connect_from_port_20 = YES #下面的就要自定义设置了,建议系统默认的不管,然后复制下面的 #是否允许匿名访问,NO为不允许 anonymous_enable = NO #是否允许本地用户访问,就是linux本机中存在的用户,YES允许 local_enable = YES #是否开启写模式,YES为开启 write_enable = YES #新建文件权限,一般设置为022,那么新建后的文件的权限就是777 - 022 = 755 local_umask = 022 #是否启动userlist为通过模式,YES的话只有存在于userlist文件中的用户才能登录ftp(可以理解为userlist是一个白名单),NO的话,白名单失效

ImportError and PyExc_SystemError while embedding Python Script within C for PAM modules (.so files)

删除回忆录丶 提交于 2019-12-01 23:06:58
问题 I'm trying to write a demo PAM module in C, which uses Embedding Python in C concept to run a script written in python (2.7), inside pam_sm_authenticate() function, which is written in C file (pam_auth.c). This is the python script: test.py import math import numpy def test_func(): a = "test" return a The path for test.py is /usr/lib/Python2.7/ so that I can easily import it. This is the C file: #define PAM_SM_AUTH #define PAM_SM_ACCOUNT #define PAM_SM_SESSION #include <security/pam_modules.h

Enable PAM configuration (limits.conf) for a running daemon

我们两清 提交于 2019-12-01 20:24:49
I'm currently attempting to develop a sandbox using Docker. Docker spawns process through a running daemon, and I am having a great deal of trouble enabling the limits set forth in the limits.conf file such that they apply to the daemon. Specifically, I am running a forkbomb such that the daemon is the process that spawns all the new processes. The nproc limitation I placed on the user making this call doesn't seemed to get applied and I for the life of me can not figure out how to make it work. I'm quiet positive it will be as simple as adding the correct file to /etc/pam.d/, but I'm not

CentOS7静默安装Oracle11gR2

落爺英雄遲暮 提交于 2019-11-30 20:53:08
使用最小化的设定安装完CentOS7后,进入安装Oracle步骤前,需要安装几个工具。具体步骤: yum -y install vim --vim编辑器 yum -y install unzip --zip文件的解压工具 yum -y install lrzsz --上传下载工具 yum -y update --升级所有包,系统版本和内核,改变软件设置和系统设置 注:使用yum安装前,先保证系统可访问互联网。如果在系统无法访问的情况下,可以配置yum资源中心为镜像文件或者下载rpm包进行安装。 完成工具的安装之后,准备进入Oracle的安装过程。 第一步: 安装必须的依赖包 yum -y install gcc yum -y install gcc-c++ yum -y install make yum -y install binutils yum -y install compat-libstdc++-33 yum -y install elfutils-libelf yum -y install elfutils-libelf-devel yum -y install elfutils-libelf-devel-static yum -y install glibc yum -y install glibc-common yum -y install glibc-devel

PAM Authentication for a Legacy Application

倖福魔咒の 提交于 2019-11-30 15:14:00
问题 I have a legacy app that receives a username/password request asynchronously over the wire. Since I already have the username and password stored as variables, what would be the best way to authenticate with PAM on Linux (Debian 6)? I've tried writing my own conversation function, but I'm not sure of the best way of getting the password into it. I've considered storing it in appdata and referencing that from the pam_conv struct, but there's almost no documentation on how to do that. Is there

PAM authentication problem

断了今生、忘了曾经 提交于 2019-11-30 14:39:53
I am using this module to authenticate using pam: http://code.google.com/p/web2py/source/browse/gluon/contrib/pam.py I can call authenticate('username','password') and it returns True/ False. It works for any 'username' but 'root'. My guess is that there is a security restriction in PAM that does not allow to check for the root password. I need to be able to check the root password. Is there anything I can change in the pam.conf or somewhere else to remove this restriction? I found the answer to your question, the problem is in the default service. when you call the function authenticate(