0

I was trying to install cassandra in my local machine following this article

I created new group and user using the following commands as suggested in the article.

root@ubuntu:~# groupadd cassandra
root@ubuntu:~# useradd -d /home/cassandra -s /bin/bash -m -g cassandra cassandra

root@ubuntu:~# grep cassandra /etc/passwd
cassandra:x:1000:1000::/home/cassandra:/bin/bash

Now on restarting the machine I could see cassandra and my old user in the login page. I am able to login to cassandra user but not into my old account. When I login , black screen is flashed and login page is displayed again.

EDIT: I am not able to do any sudo actions from terminal as cassandra user. When I try root password it is saying password is incorrect. On entering the password for 'cassandra' user, I am getting cassandra is not in the sudoers file error.

cassandra@Sharun-UbuntuBox:~$ sudo passwd sharun
[sudo] password for cassandra: 
Sorry, try again.
[sudo] password for cassandra: 
Sorry, try again.
[sudo] password for cassandra: 
'cassandra is not in the sudoers file.  This incident will be reported.

Edit2: I am able to login from terminal and these are the permissions

cassandra@Sharun-UbuntuBox:~$ su sharun
Password: 
sharun@Sharun-UbuntuBox:/home/cassandra$ getent passwd {sharun,cassandra}
sharun:x:1000:1000:Sharun,,,:/home/sharun:/bin/bash
cassandra:x:1001:1001::/home/cassandra:/bin/bash
sharun@Sharun-UbuntuBox:/home/cassandra$ ls -alh /home/
total 16K
drwxr-xr-x  4 root      root      4.0K Sep 11 15:18 .
drwxr-xr-x 25 root      root      4.0K Aug 30 23:06 ..
drwxr-xr-x 30 cassandra cassandra 4.0K Sep 11 18:02 cassandra
drwxr-xr-x 33 sharun    cassandra 4.0K Sep 11 17:59 sharun

Edit 3: I had followed the remaining commands in that article before restarting the machine:

[From the article]   ... You can correct the ownerships for the files and set proper environment variables to run this application smoothly.

    root@ubuntu:/home/cassandra# export CASSANDRA_HOME=/home/cassandra
    root@ubuntu:/home/cassandra# export PATH=$PATH:$CASSANDRA_HOME/bin
    root@ubuntu:/home/cassandra# chown -R cassandra.cassandra .

May be I have messed up the commands. Any way to undo these?

  • 1
    Can you login with the user sharun in a terminal with su - sharun? Also check the UIDs of the two users with getent passwd {sharun,cassandra} and the access rights of the homedirectories ls -alh /home/. – Thomas Sep 11 '16 at 12:28
  • @Thomas please see my edit – user593401 Sep 11 '16 at 12:36
  • What else have you entered on the command line. The group ownership of the homedirectory of user sharun is cassandra which shouldn't be. Any other things you have run chown, chgrp or chmod against? – Thomas Sep 11 '16 at 12:42
  • @Thomas Edited the question – user593401 Sep 11 '16 at 12:47
  • Unfortunately there is no undo command, so one would have to know what exactly happened. It might be save to run sudo chown -R sharun:1000 /home/sharun, as it seems some chgrp or chown command was run against that diretory and it may be the source of the problem. – Thomas Sep 11 '16 at 13:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.