Разрешить или запретить доступ SSH определенному пользователю или группе в Linux
Код: Выделить всё
root@277938:~# cat /etc/group | grep root
root:x:0:
Код: Выделить всё
timeweb@277938:~$ cat /etc/ssh/sshd_config | grep Deny
DenyUsers root
DenyGroups root
Код: Выделить всё
root@277938:/etc/ssh# systemctl restart sshd
root@277938:/etc/ssh# systemctl status sshd
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-01-09 16:08:21 MSK; 7s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 4350 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 4351 (sshd)
Tasks: 2 (limit: 544)
Memory: 17.2M
CGroup: /system.slice/ssh.service
├─4346 sshd: [accepted]
└─4351 /usr/sbin/sshd -D
янв 09 16:08:21 277938.local systemd[1]: Starting OpenBSD Secure Shell server...
янв 09 16:08:21 277938.local systemd[1]: ssh.service: Found left-over process 4346 (sshd) in control group while starting unit. Ignoring.
янв 09 16:08:21 277938.local systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
янв 09 16:08:21 277938.local sshd[4351]: Server listening on 0.0.0.0 port 22.
янв 09 16:08:21 277938.local sshd[4351]: Server listening on :: port 22.
янв 09 16:08:21 277938.local systemd[1]: Started OpenBSD Secure Shell server.
Код: Выделить всё
olej@ACER:~/2020_WORK/rus.linux.net.hist/timeweb$ ssh -l root 185.178.47.95
root@185.178.47.95's password:
Permission denied, please try again.
root@185.178.47.95's password:
^C