ulimit: open files: cannot modify limit: Operation not permitted
2019-08-19centos7.6重新安装sshd服务,oracle用户ssh登陆时候,出现错误-bash: ulimit: open files: cannot modify limit: Operation not permitted。
1、执行ulimit -n 65535没有权限,检查/etc/pam.d/login,是否添加了
session requied pam_limits.so
2、检查/etc/ssh/sshd_config,UsePAM=yes是否开启
cat /etc/ssh/sshd_config发现只有3行有效,默认sshd_config有10几行
cat /etc/ssh/sshd_config|egrep -v '^#|^$'
Port 522
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
SyslogFacility AUTHPRIV
PermitRootLogin yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication yes
ChallengeResponseAuthentication no
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
UsePAM yes
X11Forwarding yes
UsePrivilegeSeparation sandbox # Default for new installations.
UseDNS no
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
Subsystem sftp /usr/libexec/openssh/sftp-server
3、检查/etc/security/limits.conf是否设置
分类:Linux | 标签: |