Login
Disallow user login
_$: usermod -L usuario # Disallows the login with password
/etc/passwd:
------------
...
user:x:1001:1001:,,,:/home/user:/bin/false
Disallow user login with password
root@gitserver: passwd -l <user>
Note: This does not disallow the account. The user would still be able to login using an SSH key.
Disallow root login
/etc/ssh/sshd_config:
---------------------
...
# Authentication:
LoginGraceTime 120
PermitRootLogin no <===
StrictModes yes
SFTP access but no SSH access
_$: apt-get isntall rssh
_$: chsh -s /usr/bin/rssh <usuario>
/etc/rssh.conf:
---------------
...
allowsftp
...