0

I have created user with sudo useradd cloudera, User created successfully. Now I want to install ssh in cloudera user. If I execute

cloudera@ubuntu:~$ sudo apt-get install ssh
[sudo] password for cloudera: 
cloudera is not in the sudoers file.  This incident will be reported.

Now How to install ssh in newly added user?

6
  • 2
    Installation of ssh is not use specific. Install it using your primary user, the one you used to create cloudera. Then all users including cloudera will have access to ssh.
    – user68186
    Jul 28, 2017 at 3:04
  • 1
    SSH is installed globally, not "in" any user. So just install with your existing admin account.
    – muru
    Jul 28, 2017 at 3:04
  • 1
    Read man sudoers, you must add cloudera to the sudo system.
    – waltinator
    Jul 28, 2017 at 3:37
  • How to add users to sshd is well documented here: askubuntu.com/questions/16650/…
    – jones0610
    Jul 28, 2017 at 4:02
  • Do you want the server so you can connect FROM another PC or only use the SSH client to connect TO another PC?
    – derHugo
    Jul 28, 2017 at 5:30

2 Answers 2

1

When you ran sudo adduser cloudera, you used sudo. I am going to refer to this as the primary user.

If you already have ssh installed

If you already have ssh installed, you shouldn't need to do anything. You should be able to ssh into it directly.

If you don't have ssh installed

Install it in the primary user with the command sudo apt-get install openssh-server. This will install it system-wide, enabling it for all users.

If you don't know whether you have ssh installed

Run dpkg -L openssh-server. If there is any output, you have it installed. Otherwise you don't.

2
  • Still not clear if the OP wants the server or only use the client...
    – derHugo
    Jul 28, 2017 at 5:29
  • @derHugo true... I made an assumption based upon what he was saying
    – fosslinux
    Jul 28, 2017 at 5:57
0

In addition to the comments and answers already posted here is a clarification.

From whichever user you executed the command

sudo useradd cloudera

that user obviously have super user privilege.

So, from the new user most probably you could use ssh, as it might be there already installed.

Else, you have three options:

(1) From the user which created "cloudera" install ssh using sudo

(2) Add "cloudera" to sudoers and proceed.

(3) Simply type su and provide the super user password. Then proceed to install ssh.

1
  • Please also add the relevant commands to your options! sudo apt install openssh-server, sudo adduser cloudera sudo and format code as code using the {} in the editor
    – derHugo
    Jul 28, 2017 at 5:27

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.