Login permission denied linux

PAM login permission denied

I have an OpenSuSE 12.3 machine and can’t login to the box either on tty or via ssh . As soon as the user logs in the session terminates and in the message «login [1234] permission denied» is printed. The machine was set to autologin on KDE so that user autologs-in. Any Ideas? Update:
I am not sure what has changed on the system, I am not the only one who has access to the box and according to everybody nothing has changed.
The only thing that went wrong on the system was that it takes a backup of a DB on a different machine and there wasn’t any space on it. I cleared all the space after some googling updated PAM, that solved the problem.
But then the problem repeated when I check the system there wasn’t any space again, cleared the system re-installed PAM to no avail. Upgraded the system from 12.1 to 12.3 but didn’t help. There isn’t a /var/log/secure log. The only relevant message is permission denied. Users are not locked on KDE I can login with any user but not on tty or ssh , can su/sudo. There are lot of files in /etc/pam.d/ which one do I need to check

That’s pretty vague problem description What have you done so far and what are the results? What’s changed recently? etc. More information can help us get you to what you’re after sooner. At this point all I can think to tell you is to check /var/log/secure to see if anything descriptive got printed there.

It might also be worthwhile to get the PAM configuration in case there’s a problem there. I’d update your question with this information so people have more to work with.

This isn’t enough to go on. Can you confirm that the password is correct and you can su — ? Is the account locked? Look in /etc/passwd to see if their is an LK in the user’s entry.

Источник

Не могу войти в систему

Накатил на OrangePI PC2 дебиан. Вроде всё более менее работает, но встала одна непреодолимая (надеюсь, пока) проблема: после создания пользователя не могу под ним зайти. Говорит Permission denied на домашнюю директорию и /bin/bash. Права проверил — вроде есть. Проверил ACL. Не везде есть. не может выдать на /bin/bash (setfacl говорит, что Неподдерживаемая операция). мб в uEnv.txt надо какие-то опции еще указать при загрузке ядра (какие и чему равные)?

Вроде всё проверил. Что еще может быть? и как оно правится?

Также, туда отказываются вставать БД — mysql и mariadb (да, я извращенец — ставить на embedded БД). Не могут создаться сокеты, не может войти с паролем рута mysql-upgrade. Тоже пока с ходу не получилось поправить.

Читайте также:  Find linux version name

Ядро стоит из стандартной поставки (на выходных буду пробовать самосбор, ибо родной конфиг — жуть).

# ls -la /home итого 20 drwxr-xr-x 5 root root 4096 янв 14 16:14 . drwx----— 21 orangepi orangepi 4096 янв 14 17:50 .. drwxr-xr-x 2 aido aido 4096 янв 14 16:14 aido drwxr-xr-x 2 michael michael 4096 янв 14 16:13 michael drwxr-xr-x 2 orangepi orangepi 4096 янв 1 00:02 orangepi # getfacl /home/aido getfacl: Removing leading '/' from absolute path names # file: home/aido # owner: aido # group: aido user::rwx group::r-x other::r-x # ls -la /bin/bash -rwxr-xr-x 1 root root 909312 ноя 12 2014 /bin/bash # date Пт янв 15 01:42:41 UTC 2016 # getfacl /bin/bash getfacl: Removing leading '/' from absolute path names # file: bin/bash # owner: root # group: root user::rwx group::r-x other::r-x # su aido Cannot execute /bin/bash: Permission denied # login aido Пароль: Последний вход в систему:Чт янв 14 17:51:49 UTC 2016на pts/0 Linux Orangepi 3.10.65 #3 SMP PREEMPT Tue Nov 15 09:46:50 CST 2016 aarch64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Невозможно перейти в каталог «/home/aido»

# cat /etc/passwd # cat /etc/group 

Пальцем в небо. Посмотреть на всякие selinux apparmor

Ты близок. strace сказал, что виноват PAM. Геморрой предстоит долгий

Cannot execute /bin/bash: Permission denied

Раз воспроизводится через su, проще всего посмотреть на /etc/pam.d/su

Если бы у тебя не было рута, я бы сказал что воевать с огороженными системами тот ещё геморрой. Но раз рута дали, то скорее всего при создании пользователя какая-нибудь банальная ошибка. Вроде отсутствия шела в /etc/shells или не созданного домашнего каталога

Ну и хотелось бы увидеть вывод

router ★★★★★ ( 12.03.17 01:43:20 MSK )
Последнее исправление: router 12.03.17 01:45:11 MSK (всего исправлений: 1)

root@Orangepi:~# sestatus -bash: sestatus: команда не найдена root@Orangepi:~# ls -Z /home ? aido ? michael ? orangepi

aido ★★ ( 12.03.17 13:55:47 MSK )
Последнее исправление: aido 12.03.17 13:56:02 MSK (всего исправлений: 1)

strace сказал нечто вот такое:

sendto(4, "p\0\0\0Q\4\5\0\4\0\0\0\0\0\0\0op=PAM:session_o". 112, 0, , 12) = 112 ppoll([], 1, , NULL, 0) = 1 ([], left ) recvfrom(4, "$\0\0\0\2\0\0\0\4\0\0\0\321t\0\0\0\0\0\0p\0\0\0Q\4\5\0\4\0\0\0". 8988, MSG_PEEK|MSG_DONTWAIT, , [12]) = 36 recvfrom(4, "$\0\0\0\2\0\0\0\4\0\0\0\321t\0\0\0\0\0\0p\0\0\0Q\4\5\0\4\0\0\0". 8988, MSG_DONTWAIT, , [12]) = 36 close(4) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f79aa20d0) = 29906 rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], NULL, 8) = 0 rt_sigaction(SIGTERM, , NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [ALRM TERM], NULL, 8) = 0 wait4(-1, Cannot execute /bin/bash: Permission denied
root@Orangepi:~# cat /etc/pam.d/su # # The PAM configuration file for the Shadow `su' service # # This allows root to su without passwords (normal operation) auth sufficient pam_rootok.so # Uncomment this to force users to be a member of group root # before they can use `su'. You can also add "group=foo" # to the end of this line if you want to use a group other # than the default "root" (but this may have side effect of # denying "root" user, unless she's a member of "foo" or explicitly # permitted earlier by e.g. "sufficient pam_rootok.so"). # (Replaces the `SU_WHEEL_ONLY' option from login.defs) # auth required pam_wheel.so # Uncomment this if you want wheel members to be able to # su without a password. # auth sufficient pam_wheel.so trust # Uncomment this if you want members of a specific group to not # be allowed to use su at all. # auth required pam_wheel.so deny group=nosu # Uncomment and edit /etc/security/time.conf if you need to set # time restrainst on su usage. # (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs # as well as /etc/porttime) # account requisite pam_time.so # This module parses environment configuration file(s) # and also allows you to use an extended config # file /etc/security/pam_env.conf. # # parsing /etc/environment needs "readenv=1" session required pam_env.so readenv=1 # locale variables are also kept into /etc/default/locale in etch # reading this file *in addition to /etc/environment* does not hurt session required pam_env.so readenv=1 envfile=/etc/default/locale # Defines the MAIL environment variable # However, userdel also needs MAIL_DIR and MAIL_FILE variables # in /etc/login.defs to make sure that removing a user # also removes the user's mail spool file. # See comments in /etc/login.defs # # "nopen" stands to avoid reporting new mail when su'ing to another user session optional pam_mail.so nopen # Sets up user limits according to /etc/security/limits.conf # (Replaces the use of /etc/limits in old login) session required pam_limits.so # The standard Unix authentication modules, used with # NIS (man nsswitch) as well as normal /etc/passwd and # /etc/shadow entries. @include common-auth @include common-account @include common-session

aido ★★ ( 12.03.17 13:58:54 MSK )
Последнее исправление: aido 12.03.17 14:02:30 MSK (всего исправлений: 2)

Читайте также:  Kaspersky security center linux vs windows

clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f79aa20d0) = 29906

Сдаётся мне, самое интересное происходит дальше, в потомке PID 29906. А этот процесс только печатает на экран окончательный диагноз

я обычно запускаю strace с отслеживанием форков ( -f -ff )

strace -f -ff -T -s8192 -o /tmp/strace_$ -- $ $

Потом можно просто грепнуть /tmp/strace_* по фразе «Permission denied»

если ты считаешь, что дело в pam, проверяй построчно, что делают все перечисленные модули, включая include’ы. Но скорее всего дело не в нём, см. выше

selinux отключен, с этой стороны сюрпризов не будет.

Но есть ещё AppArmor. Как его статус проверить — не знаю

пасиб. Оказалось вот такое (но там права 644 на все файлы в /usr/share/locale/ru/LC_MESSAGES. для чтения должно хватать):

execve("/bin/bash", ["bash"], [/* 14 vars */]) = -1 EACCES (Permission denied) faccessat(AT_FDCWD, "/bin/bash", R_OK|X_OK) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru_RU.UTF-8/LC_MESSAGES/shadow.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru_RU.utf8/LC_MESSAGES/shadow.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru_RU/LC_MESSAGES/shadow.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru.UTF-8/LC_MESSAGES/shadow.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru.utf8/LC_MESSAGES/shadow.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru/LC_MESSAGES/shadow.mo", O_RDONLY) = -1 EACCES (Permission denied) dup(2) = 3 fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|0x20000) fstat(3, ) = 0 mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac681000 lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) openat(AT_FDCWD, "/usr/share/locale/ru_RU.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru_RU.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru_RU/LC_MESSAGES/libc.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 EACCES (Permission denied) openat(AT_FDCWD, "/usr/share/locale/ru/LC_MESSAGES/libc.mo", O_RDONLY) = -1 EACCES (Permission denied) write(3, "Cannot execute /bin/bash: Permission denied\n", 44) = 44

aido ★★ ( 12.03.17 19:50:29 MSK )
Последнее исправление: aido 12.03.17 19:55:25 MSK (всего исправлений: 1)

Читайте также:  No pubkey astra linux

Файлы ладно. Ты ещё по каталогам до корня пройдись

оказалось, что не было прав на корень. ппц. chmod 755 / && chmod 755 /bin && chmod 755 /lib всё разрешило.

Если дистрибутив debian под orange pi собирал не ты, сообщи разработчику, что он рукожоп

З.Ы. Виндузятники и «кул-вебмастеры» любят на автомате делать chmod 777 и вообще не заморачиваются с правами. Возможно, разработчик как раз из таких хакиров

router ★★★★★ ( 14.03.17 01:57:45 MSK )
Последнее исправление: router 14.03.17 02:00:50 MSK (всего исправлений: 2)

Источник

unable to login : permission denied

I recently created a new user on a Linux machine (Red hat). I was able to su — that user and it worked fine at that time. I shared the credentials with user. User reported that he is not able to login. So I tried to login to his account using PuTTY and I got permission denied error. I am able to su — user through root user.

Ether the user is denied through system settings (sshd config, userdb — it will help if you tell us how you created the user) or more likely he’s entering the wrong password — did you try to login with the user credentials?

1 Answer 1

Check the ownership of the user’s home dir :

If a different user owns the file:

sudo chown root:root / sudo chmod 755 / sudo chown root:root /home sudo chmod 755 /home sudo chown -R username:username /home/username sudo chmod 755 -R /home/username 

You usually get a successful login with cwd as / is this case and a message of sort like «Could not chdir to home directory. «

it’s only about ownershipt and permissions , look at my folders infos : younes@emachines:~$ ls -ld / drwxr-xr-x 25 root root 4096 Oct 12 14:33 / younes@emachines:~$ ls -ld /home drwxr-xr-x 3 root root 4096 Oct 5 23:40 /home younes@emachines:~$ ls -ld /home/younes drwxr-xr-x 10 younes younes 4096 Oct 12 14:53 /home/younes younes@emachines:~$ now try theses cmds : sudo chown root:root / sudo chmod 755 / sudo chown root:root /home sudo chmod 755 /home sudo chown -R username:username /home/username sudo chmod 755 /home/username

Источник

Оцените статью
Adblock
detector