Jason Yu
asked on
cannot su to another user on ec2 aim instance
I have an ec2 instance which is AIM.
root@monitor:/home/ec2-use r$ cat /etc/*-release
NAME="Amazon Linux AMI"
VERSION="2014.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2014.09"
PRETTY_NAME="Amazon Linux AMI 2014.09"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:li nux:2014.0 9:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2014.09
root@monitor:/home/ec2-use r$
When I tried to su to another user "elasticsearch", it doesn't let me switch. Please take a look and give me some advise.
[ec2-user@monitor ~]$ su - elasticsearch
Password:
Last failed login: Tue Jun 7 00:26:31 UTC 2016 on pts/1
There was 1 failed login attempt since the last successful login.
This account is currently not available.
[ec2-user@monitor ~]$ sudo su - elasticsearch
Last login: Tue Jun 7 00:26:58 UTC 2016 on pts/1
This account is currently not available.
[ec2-user@monitor ~]$ sudo su
root@monitor:/home/ec2-use r$ su - elastissearch
su: user - does not exist
root@monitor:/home/ec2-use r$ su - elasticsearch
su: user - does not exist
root@monitor:/home/ec2-use r$ cat /etc/passwd
root:x:0:0:root:/root:/bin /bash
bin:x:1:1:bin:/bin:/sbin/n ologin
daemon:x:2:2:daemon:/sbin: /sbin/nolo gin
adm:x:3:4:adm:/var/adm:/sb in/nologin
lp:x:4:7:lp:/var/spool/lpd :/sbin/nol ogin
sync:x:5:0:sync:/sbin:/bin /sync
shutdown:x:6:0:shutdown:/s bin:/sbin/ shutdown
halt:x:7:0:halt:/sbin:/sbi n/halt
mail:x:8:12:mail:/var/spoo l/mail:/sb in/nologin
uucp:x:10:14:uucp:/var/spo ol/uucp:/s bin/nologi n
operator:x:11:0:operator:/ root:/sbin /nologin
games:x:12:100:games:/usr/ games:/sbi n/nologin
gopher:x:13:30:gopher:/var /gopher:/s bin/nologi n
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/s bin/nologi n
saslauth:x:499:76:"Saslaut hd user":/var/empty/saslauth: /sbin/nolo gin
mailnull:x:47:47::/var/spo ol/mqueue: /sbin/nolo gin
smmsp:x:51:51::/var/spool/ mqueue:/sb in/nologin
ntp:x:38:38::/etc/ntp:/sbi n/nologin
sshd:x:74:74:Privilege-sep arated SSH:/var/empty/sshd:/sbin/ nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
tcpdump:x:72:72::/:/sbin/n ologin
ec2-user:x:500:500:EC2 Default User:/home/ec2-user:/bin/b ash
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
nslcd:x:65:55:LDAP Client User:/:/sbin/nologin
postgres:x:26:26:PostgreSQ L Server:/var/lib/pgsql:/bin /bash
nagios:x:498:498::/var/spo ol/nagios: /sbin/nolo gin
rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind: /sbin/nolo gin
icinga:x:497:497:icinga:/v ar/spool/i cinga:/sbi n/nologin
apache:x:48:48:Apache:/var /www:/sbin /nologin
postfix:x:89:89::/var/spoo l/postfix: /sbin/nolo gin
elasticsearch:x:496:495:el asticsearc h user:/usr/share/elasticsea rch:/sbin/ nologin
logstash:x:495:494:logstas h:/opt/log stash:/sbi n/nologin
graphite:x:91:91::/opt/gra phite:/sbi n/nologin
openvpn:x:494:493:OpenVPN: /etc/openv pn:/sbin/n ologin
smstools:x:493:492::/var/l ib/smstool s:/bin/bas h
root@monitor:/home/ec2-use r$
root@monitor:/home/ec2-use
NAME="Amazon Linux AMI"
VERSION="2014.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2014.09"
PRETTY_NAME="Amazon Linux AMI 2014.09"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:li
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2014.09
root@monitor:/home/ec2-use
When I tried to su to another user "elasticsearch", it doesn't let me switch. Please take a look and give me some advise.
[ec2-user@monitor ~]$ su - elasticsearch
Password:
Last failed login: Tue Jun 7 00:26:31 UTC 2016 on pts/1
There was 1 failed login attempt since the last successful login.
This account is currently not available.
[ec2-user@monitor ~]$ sudo su - elasticsearch
Last login: Tue Jun 7 00:26:58 UTC 2016 on pts/1
This account is currently not available.
[ec2-user@monitor ~]$ sudo su
root@monitor:/home/ec2-use
su: user - does not exist
root@monitor:/home/ec2-use
su: user - does not exist
root@monitor:/home/ec2-use
root:x:0:0:root:/root:/bin
bin:x:1:1:bin:/bin:/sbin/n
daemon:x:2:2:daemon:/sbin:
adm:x:3:4:adm:/var/adm:/sb
lp:x:4:7:lp:/var/spool/lpd
sync:x:5:0:sync:/sbin:/bin
shutdown:x:6:0:shutdown:/s
halt:x:7:0:halt:/sbin:/sbi
mail:x:8:12:mail:/var/spoo
uucp:x:10:14:uucp:/var/spo
operator:x:11:0:operator:/
games:x:12:100:games:/usr/
gopher:x:13:30:gopher:/var
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/s
saslauth:x:499:76:"Saslaut
mailnull:x:47:47::/var/spo
smmsp:x:51:51::/var/spool/
ntp:x:38:38::/etc/ntp:/sbi
sshd:x:74:74:Privilege-sep
dbus:x:81:81:System message bus:/:/sbin/nologin
tcpdump:x:72:72::/:/sbin/n
ec2-user:x:500:500:EC2 Default User:/home/ec2-user:/bin/b
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
nslcd:x:65:55:LDAP Client User:/:/sbin/nologin
postgres:x:26:26:PostgreSQ
nagios:x:498:498::/var/spo
rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:
icinga:x:497:497:icinga:/v
apache:x:48:48:Apache:/var
postfix:x:89:89::/var/spoo
elasticsearch:x:496:495:el
logstash:x:495:494:logstas
graphite:x:91:91::/opt/gra
openvpn:x:494:493:OpenVPN:
smstools:x:493:492::/var/l
root@monitor:/home/ec2-use
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
elasticsearch is normally started by root from /etc/init.d at system initilization.
The product offers the configuration parameters:
ES_USER (default: elasticsearch) and ES_GROUP (default: elasticsearch)
under whose credentials and names the background process will run.
So the user elasticsearch isn't required to be able to login.
The product offers the configuration parameters:
ES_USER (default: elasticsearch) and ES_GROUP (default: elasticsearch)
under whose credentials and names the background process will run.
So the user elasticsearch isn't required to be able to login.
ASKER
Thanks, I will go ahead run it as root as before.
ASKER
If I need start it as elasticsearch user, I have to enable the login for this user?
thanks.