Results 1 to 5 of 5

Thread: NO ssh login for local user from passwd

  1. #1

    Exclamation NO ssh login for local user from passwd

    Hi guys,

    after configuration vsftpd I need to disallow ssh login (port 22) for all users in /etc/passwd except root user.

    Exist any command to do that, or the easier way is to erase some char in /etc/passwd?

    thx!

  2. #2
    replace the shell of the users in /etc/passwd with /sbin/nologin

    example:
    Code:
    root:---------------:0:0:root:/usr/local/root:/bin/sh
    nobody:x:99:99:nobody:/:/sbin/nologin
    ftp:----------------:501:501:Linux User,,,:/home/ftp:/sbin/nologin

  3. #3
    Quote Originally Posted by DrChair View Post
    replace the shell of the users in /etc/passwd with /sbin/nologin

    example:
    Code:
    root:---------------:0:0:root:/usr/local/root:/bin/sh
    nobody:x:99:99:nobody:/:/sbin/nologin
    ftp:----------------:501:501:Linux User,,,:/home/ftp:/sbin/nologin
    Thanks for reply, but this is not exactly what I want, because now users cannot login over ftp:-(
    What I want is to forbid only SSH login.

  4. #4
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    Here is an example for similar purpose which I can quickly find
    http://subversion.apache.org/faq.htm...zed-keys-trick
    However, you have to install openssh. dropbear doesn't allow this trick

  5. #5
    Quote Originally Posted by Stewa View Post
    Thanks for reply, but this is not exactly what I want, because now users cannot login over ftp:-(
    What I want is to forbid only SSH login.
    Strange...
    I copied the sample out of my own passwd file (I only changed the password-hash into -------) But I can use the user ftp for ftp, but not for ssh.

    I'm using ProFTPD, and apparently that doesn't check if the usershell exists.
    cause when I checked it at my router, I found that /sbin/nologin is missing.

    I guess your ftp-server (vsftpd?) however does check it.

    You can try it with /bin/false as the user-shell, that one does exist and serves the same purpose.

Similar Threads

  1. [HowTo] Install and configure Oleg's firmware
    By wengi in forum WL-500gP Tutorials
    Replies: 957
    Last Post: 22-02-2013, 22:24
  2. частые реконнекты на WL-500gP v2
    By Jelezni in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 8
    Last Post: 10-10-2009, 21:15
  3. Превью новой версии прошивки 1.9.2.7-9
    By Oleg in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 804
    Last Post: 14-03-2009, 19:42
  4. Nach Neustart USER aus passwd gelцscht
    By carterb in forum German Discussion - Deutsch (DE)
    Replies: 2
    Last Post: 07-02-2008, 17:37

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •