This is my first server I have set up and I used ubuntu 14.04 to run it. I opted not to use the server install because the regular ubuntu was easier to setup. Now I wanted to make the server available for SSH and VNC so that I could manage it remotely and disconnect the monitor, but I can not figure either of them out. I installed openSSH server but every time I try to connect with my mac it says "connection closed by server IP" It is seriously the most frustrating thing because everywhere I look online it just says install OpenSSH and it should work. I dont completely understand the modifications to the sshd_config page or if I actually need to modify it for everything to work. I have pinged both ways and both work. I can connect to my mac from the ubuntu server but not the other way. All firewalls are off. Can someone please help me?
You need to start the service on the ubuntu server, just use the following command
service sshd start
Below is what to do after installing the openssh-server on 14.04 Trusty Tahr.
You can change the port, disable root login and other useful things by editing the config file:
sudo gedit /etc/ssh/sshd_config
Finally restart the ssh server to take place:
sudo /etc/init.d/ssh restart
More information on sshd_config can be found here.
Chech if you did install openssh-server server .
sudo apt-get install openssh-server
then check you have proper port enabled
if you go in it with different port number from outside or your router has a rule of forwarding it to another port
you may also need to uncomment in there if you want to be authorized by password.
Check /etc/ssh/sshd_config for one of the following,
- LoginGraceTime and make sure that is set to a time limit that you can enter your password. Otherwise it will close the connection if your request doesn't get authenticated within the timeframe. (example: this will give you a 1min window, LoginGraceTime 60)
- "UseDNS no" will make sure sshd would not try to resolve the hostname. If the ssh client computer and the server are using two different nameservers and they point to different IPs for the same hostname might end up locking you out. So "UseDNS no" would resolve such problems.
- "PasswordAuthentication yes" will make sure the SSHd accepts user entered passwords.
Also make sure the bash_profile/bashrc scripts that are used by the user you login as to the remote server ( ssh email@example.com ) don't have any exit commands used within those scripts. Otherwise as soon as you login it will close the connection.
That's all I have come across for this issue.