4

I have set up a Debian Linux server, now I want to disable the shell so the user can't login and just connect via SFTP. But my /usr/bin/nologin is missing for some reason. In which package is it located?

5

First of all, nologin is located in /usr/sbin, not in /usr/bin. It is shipped with the package login:

$ whereis nologin
nologin: /usr/sbin/nologin /usr/share/man/man8/nologin.8.gz /usr/share/man/man5/nologin.5.gz
$ dpkg --search /usr/sbin/nologin
login: /usr/sbin/nologin
| improve this answer | |
0

I am more familiar with RedHat style Linux distributions than with Debian style. But in my experience, nologin is /usr/sbin/nologin and it is provided by a package named util-linux.

| improve this answer | |
0

It is located in /usr/sbin not /usr/bin.

Use find command to find files: find / -name nologin

The package is called "login" (dpkg -S /usr/sbin/nologin).

Alternatively you can also use /bin/false.

| improve this answer | |
  • Wouldn't be locate much easier? Is there any difference/upside in using find? – linkD Oct 31 '14 at 10:50
  • Find is slower. It looks real time at the file system. Locate does that once per day (usually around 3AM, when it is unlikely to bother the user). – Hennes Oct 31 '14 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.