0

I tried following this: https://linuxize.com/post/how-to-install-tomcat-9-on-ubuntu-18-04/

in the last part of the heading Step3: Install Tomcat when I run the command:

sudo useradd -r -m -U -d /opt/tomcat -s /bin/false tomcat

I get error:

chmod: cannot access '/opt/tomcat/latest/bin/*.sh': No such file or directory

what should I do? Or is there some simpler page out there? I do want to learn. But it seems lot of sites use "fancy" commands and dont tell what they do. And then when something like this happens, a noob is lost. Im guessing I had to change to "tomcat" user somewhere along the line, but it doesnt say where and how. I found that one can change by using su - tomcat. But following the site... i cant say where the passwd is set if at all. So im in a weird position where I dont even know what passwd tomcat user now has :-/.

0

Did you check the /opt/ directory to ensure that the tomcat folder is there? That error can indicate that there is no directory the command is referencing.

For example, it cannot change permission on a directory that does not exist.

Try this instead:

Create a new group for tomcat-

sudo groupadd tomcat

Now create a new user, in this case called tomcat. Make the user a member of the tomcat group. Make that users home directory /opt/tomcat and give it a shell of /bin/false

sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat

Source:https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04

3
  • whats with the -s /bin/false? manpage sayes -s option has to do with aming shell. Usually its /bin/bash right? Does this, erm, the user cant use a terminal because of that option? – brat Dec 13 '19 at 8:34
  • 1
    I checked and apparently /bin/false makes it a "system level" user, thus a user Im not supposed to log into. Which makes me think, why would I do that, because now I have pretty much locked myself out of that directory (since sudoing in with my other user wont work either now), and how am I supposed to change stuff in the directory if need be? It all seems weird to me x). I went the easy way around and just installed tomcat in a directory of my usual user :) – brat Dec 13 '19 at 11:45
  • @brat that can work, but it is usually not recommended. You shouldn't need to worry a lot about accessing the directories because I believe they are just for installation. – FRALEWHALE Dec 13 '19 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.