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>@220.127.116.11 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>@18.104.22.168
// the response from server is that: debug1: connect to address 22.214.171.124 port 222: Resource temporarily unavailable // its the same that i treat to connect whit root
ssh -p 222 email@example.com
you can help me what´s happend?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.