An error occurs when I try to make SSH connection:
$ ssh -p 22 www-data@x.x.x.x
This account is currently not available
An error occurs when I try to make SSH connection:
$ ssh -p 22 www-data@x.x.x.x
This account is currently not available
While I agree with the others that allowing login through SSH through the www-data user is generally a bad idea, once you've logged in with a normal user it may be useful to run multiple commands concurrently with the permissions set of the www-data user. In that case, one can run
sudo su -l www-data -s /bin/bash
and you will be able to access your files as the www-data user.
-s /bin/bash
– Couitchy
Jun 04 '19 at 13:20
git pull
without su - www-data
?
and generate rsa key for www-data
user
– Vasilii Suricov
Nov 24 '19 at 19:55
You're getting the This account is currently not available.
error because the shell for the user www-data
is set to /usr/sbin/nologin
, and it's set for a very good reason. You should not log in as www-data
, it's a special user/group used by the web server, not intended for regular shell use.
EDIT: It is an especially bad idea to give sudo
rights to www-data
. If Apache was intended to run with root permissions, it wouldn't have it's own group. By doing this, you are creating huge security holes. You have been warned.
root
, or add a login shell to www-data
, but that's like opening a bottle of wine by breaking the bottle because you're too lazy and careless to use a cork-screw.
– kraxor
Mar 23 '16 at 13:08
This (launching an headless LibreOffice as user www-data) used to work in previous versions of Ubuntu, and I understand that this is a security improvement over these earlier versions.
– ywarnier Jul 21 '16 at 23:05This is working fine as a replacement to the previous launching as www-data.
– ywarnier Jul 21 '16 at 23:07/bin/sh
for www-data user then exploited the security right ?
– Nullpointer
Jun 21 '17 at 12:19
The first question I would have to ask is, what are you trying to accomplish by doing this?
kraxor is 100% correct you should never be able to ssh into your server using your Apache/Nginx user. Doing so invites every hacker with half a brain cell into your server.
If you need to run a script or some program as that user you could try sudo -u www-data yourscript
or you could temporally chown
on the file to a user with login privileges. It's just a vary bad idea to allow this account that kind of access.