outroll / vesta

VESTA Control Panel
http://vestacp.com
GNU General Public License v3.0
2.97k stars 1.03k forks source link

Incorrect nologin path on debian #1900

Open Sandjab opened 5 years ago

Sandjab commented 5 years ago

Operating System (OS/VERSION):

root@aldebaran:~#` lsb_release -d
Description:    Debian GNU/Linux 9.9 (stretch)
root@aldebaran:~# uname -r
4.9.0-9-amd64

VestaCP Version:

0.9.8-24

Installed Software (what you got with the installer):

bash vst-install.sh --nginx yes --apache yes --phpfpm no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin yes --clamav yes --softaculous yes --mysql yes --postgresql no ...

Steps to Reproduce:

1) In Vesta CP, create a user with nologin shell

2) Try to invoque a shell for this user

root@aldebaran:~# su - theuser
Cannot execute /sbin/nologin: No such file or directory

Expected result is:

root@aldebaran:/sbin# su - theuser
This account is currently not available.

Related Issues/Forum Threads:

Did not find anything directly related.

1792 is of the same family but complaining about the "nologin" option not being avaible in control panel on CentOS (which is not the case here, all shells are available in the dropdown list)

Other Notes:

The /etc/shells file content is:

root@aldebaran:/etc# more /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/sbin/nologin
/usr/sbin/nologin
/usr/bin/rssh
/sbin/nologin

Multiple entries for nologin seems to be created by /usr/local/vesta/install/vst-install-debian.sh Here:

661 # Register /sbin/nologin and /usr/sbin/nologin
662 echo "/sbin/nologin" >> /etc/shells
663 echo "/usr/sbin/nologin" >> /etc/shells

and here:

936 if [ "$vsftpd" = 'yes' ]; then
937     cp -f $vestacp/vsftpd/vsftpd.conf /etc/
938     update-rc.d vsftpd defaults
939     service vsftpd start
940     check_result $? "vsftpd start failed"
941
942     # To be deleted after release 0.9.8-18
943     echo "/sbin/nologin" >> /etc/shells
944 fi

Abstract

Qualification: cosmetic (it's more a code cleaning issue) Analysis: On Debian 9, nologin sits in the /usr/sbin directory and not in the /sbin directory. Vesta install scripts should take this into account. May work just by deleting lines 662, 942 and 943 in vst-install-debian.sh (?) QuickFix: I didn't dare to change anything, so i just created a symlink: cd /sbin ln -fs /usr/sbin/nologin nologin

Skamasle commented 5 years ago

Yes is a know bug I think is alredy fixed in master release.