Report this

What is the reason for this report?

SSH New user Ubuntu 14.04

Posted on April 19, 2015

Situation : i want to add a new user and disable the root login . The new user will be a sudo user and on auth with the server it should only connect trough SSH no password auth . i followed multiple guides here on DO and did some googling myself but i fail at getting it all working . here are some steps i take .

i login as root : /usr/sbin/adduser username i get prompted for a password and set one .

User privilege : nano /etc/sudoers and add : username ALL=(ALL) ALL

i test and confirm that i can login with the new user with a password and i have sudo .

i login back as root and edit the sshd_config file nano /etc/ssh/sshd_config

next up is a question : should i set PermitRootLogin to No ? or to without-password ? i see allot of people recommend to set it to no . So i do set it to NO

i add AllowUsers username and restart sushi with service ssh restart Logout and try to connect again with root get prompted for a password but no password was set because on creation of the droplet i added a SSH key . So things look okay Root user login is disabled . And i can still login with the new user but only trough the password prompt .

THE PROBLEM : with the SSH key and password .

i add the ssh key cat ~/.ssh/id_rsa.pub | ssh user@123.456.78.90"mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys since the ssh-copy-id does not seem to work for me ( mac user ) next my terminal just prompts me with a > what do i do from here ? i can paste the public key but how do i save it and next how do i disable the password login for the user and only auth on the ssh key .

Thank you in advance for the reply if anything i mention here above raises a security flag please let me know .

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.