I’ve been struggling for a while now logging into my ssh server. So i’m using virtualbox to run opensuse linux 11.3 and i have 2 machines on it, a server and a client. First of all i start the ssh demon on both devices and i log in with ssh using the command ssh servername@serverip, I’m doing everything on the client machine. After that i create an ssh directory and set the permission to chmod 700 and i exit from the ssh . Then on the client i go into the ssh folder and create an rsa key and then i copy it with scp key.pub servername@serverip:.ssh/. After this i log into ssh once again with the same method , go into the ssh folder and do the following command: cat key.pub >> authorized_keys. After this i log out and make a config file and write this into it : Host szerver , Hostname serverip , User servername , Port 22 , Protocol 2 , identityfile ~/.ssh/key. Then after all these i try logging in with the command ssh szerver and it just doesn’t work. I mean it works but only if im root. As long as I’m su-d in on my client i can log in without password. But when i log out and im just a client user im no longer able to log in with this command cause it says “Could not resolve hostname szerver”. Since then i restarted my computer and i just not able to connect to ssh anymore, no matter what i do, port 22 is listening, ssh is running but is says port 22 is unreachable.
my assumption is that your /etc/hostname doesn’t have any entry for your server to map it to the ip address. try to do ssh user@ip_address and see if that is successfull. if yes then you need to map this in the /etc/hostname file as root.