Hello, I create and change the configuration of one user diferent of root, for permissions is like a root. and i create the public key and paste into a ‘/home/<newuser>/.ssh/authorized_keys’ file, I do that exactly:
ssh <newuser>@46.101.46.71 sudo mkdir .ssh sudo chmod 0700 .ssh sudo touch .ssh/authorized_keys sudo chmod 0644 .ssh/authorized_keys sudo chown <newuser> ~/.ssh -R sudo nano .ssh/authorized_keys // i paste the pub key here a goout
// saving file sudo nano /etc/ssh/sshd.config
// in this file I put that Port 222 PubKeyAuthentication yes AuthorizedKeysFile %h/.ssh/authorized_keys PermitEmptyPasswords no PermitRootLogin yes // by the moment
// I go out saving file
sudo systemctl restart sshd.service // restart service exit
// now in my local ubuntu
ssh -p 222 <newuser>@46.101.46.71
// the response from server is that: debug1: connect to address 46.101.46.71 port 222: Resource temporarily unavailable // its the same that i treat to connect whit root
ssh -p 222 root@46.101.46.71
you can help me what´s happend?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
I could suggest a couple of things:
sudo chmod 0600 .ssh/authorized_keys
Also if you have a firewall like ufw, make sure to open port 222, as the error that you are getting indicates that your local PC is unable to connect to the Droplet on that port.
You can add the -vvv argument to your SSH command for some extra debug information:
ssh -vvv -p 222 <newuser>@46.101.46.71
Let me know how it goes! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.