Ask Your Question

Why i cannot log with apache user?

asked 2016-10-01 12:22:33 -0600

patterson gravatar image

I'm using Fedora 24 and Apache 2.4

I tried to log as apache user:

# su - apache
This account is currently not available.

Can anyone helpe me?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2016-10-01 15:13:17 -0600

muep gravatar image

My impression is that the apache account in fedora is intentionally set up so that it can not be used as a login account.

Why do you wish to log in as apache? If you just want to try if some command works as that user, use of sudo -u apache somecommand or something like that might work as an alternative.

edit flag offensive delete link more



No, even that won't work because the apache user's shell is set to /sbin/nologin in /etc/passwd for security reasons. Why do you feel the need to work as apache?

sideburns gravatar imagesideburns ( 2016-10-01 15:39:55 -0600 )edit

I do not know if it is expected to work, but at least it did work on my system when I tried it.

muep gravatar imagemuep ( 2016-10-02 12:19:06 -0600 )edit

OK, reading man sudo I see that the command you suggest runs under your shell, but as the apache user. Not a bug, but possibly a misfeature, as it allows you to run as users who aren't supposed to be used. Odd.

sideburns gravatar imagesideburns ( 2016-10-02 12:53:57 -0600 )edit

answered 2016-10-01 15:55:09 -0600

jmt gravatar image

For security reasons logging in on a terminal as the "apache" user is disabled. The same thing applies to most of the system accounts on the OS. If you really have to log in on a terminal as "apache", you need to change the login shell of the "apache" user from /sbin/nologin to some working shell such as /bin/bash using chsh.

But remember: The /sbin/nologin entry is there for a good reason.

edit flag offensive delete link more


Using chsh won't work because you can only use it to change your own default shell, not another user's. What will work is editing the appropriate line in /etc/passwd and replacing /sbin/nologin with the path to a working shell.

sideburns gravatar imagesideburns ( 2016-10-01 16:29:42 -0600 )edit

answered 2016-10-01 17:43:10 -0600

ptselios gravatar image

updated 2016-10-01 17:43:37 -0600

As root:

su - apache -s /usr/bin/bash
edit flag offensive delete link more

Question Tools


Asked: 2016-10-01 12:22:33 -0600

Seen: 325 times

Last updated: Oct 01 '16