create ssh server on my ubuntu 14.04 LTS
I am a beginner ubuntu user and recently I wanted to create an ssh server on my desktop so I can access is when I'm at work through my macbook pro.
I've installed openssh
sudo apt-get install openssh-serverand I've checked my ipaddress using ifconfig. But when I try to ssh into it I keep getting the following error:
Permission denied (publickey)Also I am using xfinity and I've enabled port forwarding on my router. I've looked for tutorials on youtube and other forums but they were all tutorials using putty.
What do i need to do to make it work?
11 Answer
On your server (your desktop) temporary enable the password authentication. Open the ssh-server configuration
sudo nano /etc/ssh/sshd_configand enable the password authentication
PasswordAuthentication yesReload the configuration
sudo service ssh reloadNow you could login via ssh and password. If you want the key authentication, follow the additionally steps below.
On your client (MacBook), create a new key pair:
ssh-keygenCopy your public key via ssh-copy-id
ssh-copy-id -i ~/.ssh/id_rsa.pub -p 22 user@server or as alternative
cat id_rsa.pub | ssh server cat >> ~/.ssh/authorized_keys On your server (your desktop)
sudo nano /etc/ssh/sshd_configand disable the password authentication
PasswordAuthentication noReload the configuration
sudo service ssh reload 2