Authorized users only. All activities may be monitored and reported.

Authorized users only. All activities may be monitored and reported.

1. ssh密钥对认证登录,提示:
Authorized user only. All activities may be monitored and reported.
shell request failed on channel 0

原因:
连接用户的进程上限问题

解决:
修改 /etc/security/limits.conf 或 /etc/security/limits.d/20-nproc.conf 中的该用户相关的设置
user1   soft   nproc   4096

Authorized users only. All activities may be monitored and reported._第1张图片

可能是连接的用户进程上限。

可考虑让root用户去修改/etc/security/limits.conf 或 /etc/security/limits.d/20-nproc.conf 中的该用户相关的设置。

22.4 [lightdb@localhost ~]$ cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#This file sets the resource limits for the users logged in via PAM.
#It does not affect resource limits of the system services.
#
#Also note that configuration files in /etc/security/limits.d directory,
#which are read in alphabetical order, override the settings in this
#file in case the domain is the same or more specific.
#That means for example that setting a limit for wildcard domain here
#can be overriden with a wildcard setting in a config file in the
#subdirectory, but a user specific setting here can be overriden only
#with a user specific setting in the subdirectory.
#
#Each line describes a limit for a user in the form:
#
#            
#
#Where:
# can be:
#        - a user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
# can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
# can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open file descriptors
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#
#                 
#

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4

# End of file
lightdb hard core unlimited
lightdb soft core unlimited
lightdb hard nofile 524288
lightdb soft nofile 524288
lightdb hard nproc 16384
lightdb soft nproc 16384
22.4 [lightdb@localhost ~]$ cat /etc/security/limits.d/20-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     4096
root       soft    nproc     unlimited
22.4 [lightdb@localhost ~]$ ping 10.19.69.186
PING 10.19.69.186 (10.19.69.186) 56(84) bytes of data.
^C
--- 10.19.69.186 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3062ms

22.4 [lightdb@localhost ~]$ 

实在不行,用下面跳转的方式:

[lightdb@lightdb1 ~]$ ssh [email protected]
The authenticity of host '10.20.248.5 (10.20.248.5)' can't be established.
ECDSA key fingerprint is SHA256:ijuCD5sp64kuWuVK9iv17eVB9a+hl3P6qW64pD52/1I.
ECDSA key fingerprint is MD5:56:61:ed:24:ec:fe:d2:49:e8:cf:df:6f:f1:02:57:7b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.20.248.5' (ECDSA) to the list of known hosts.

Authorized users only. All activities may be monitored and reported.
[email protected]'s password: 

Authorized users only. All activities may be monitored and reported.
Web console: https://localhost:9090/ or https://10.20.248.5:9090/

Last login: Tue Apr 25 13:09:32 2023 from 10.188.127.39

[lightdb@localhost ~]$ ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens192: mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:8f:29:28 brd ff:ff:ff:ff:ff:ff
    inet 10.20.248.5/24 brd 10.20.248.255 scope global ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe8f:2928/64 scope link 
       valid_lft forever preferred_lft forever
[lightdb@localhost ~]$ ll
 

你可能感兴趣的:(服务器,linux,ssh)