0

Obviously I'm a noob that started playing with linux lately and I have set up a debian linux box on an old computer that's connecting to the internet wireless using through router. I would like to know how can I access it remotely (from command line or a graphical interface) using SSH or any other way from windows, linux and OS X.

Tried teamviewer succesfully but I would like a direct connexion between me and the targeted linux box

I first tried connecting with putty from windows but I need to know what's the target ip address.

Doing sudo ip addr show is showing me 192.168.0.192 and that's not an external ip

faceoff
  • 901
  • 3
  • 11
  • 16
  • At first of all you should tell us which Linux distri you're using. After that you might check if you have your ssh server running. Just try "ps aux | grep ssh" and look for a running process. if not you need to start it and set everything up. – Jodn Feb 14 '16 at 13:18
  • You _usually_ cannot connect from the outside to an internal system using the external ip address of the router connecting the internal network to the outside, without having configured a port forwarding. And it is questionable if that is a good idea. – arkascha Feb 14 '16 at 13:18
  • @ Jodn I'm using kali-linux-2016.1-amd64 and runnig "ps aux | grep ssh" I get 2 processes "/urs/bin/ssh-agent x-session-manager" and "grep ssh" – faceoff Feb 14 '16 at 13:25
  • @arkascha I can understand why that could not be a good ideea as my linux box might get accessed without permission but I'll try to use a long/secure password. I'm doing this for testing purposes anyway so I would really want to know how it's done – faceoff Feb 14 '16 at 13:27
  • 1
    @faceoff Try to start the sshd service with "sudo service ssh start". if the service was not found you might need to install sshd first. you can do it with "sudo apt-get install openssh-server". but you might google for "installing sshd on kali" or something first ;) And after that - as arkascha mentioned - you need to configure your router to forward the port (default 22) to get access from outside. Therefore you should consider some security aspects. – Jodn Feb 14 '16 at 13:34
  • To raise security do _not_ rely on passwords, use key based access to your ssh server. In fact you should disable to password based access option completely. – arkascha Feb 14 '16 at 13:43
  • For the network access: @Jodn has pointed out the required steps pretty well. You should be able to follow that guide. – arkascha Feb 14 '16 at 13:44
  • Ah, one more hint: you should _not_ expose ssh on port 22 by means of port forwarding. Chose any other, unprivileged port for that, something greater than 10000. By using a non standard port you effectively keep out all those annoying script kiddies scanning the internet for open ports. – arkascha Feb 14 '16 at 13:45
  • Running "sudo service ssh start" shows no error so I assume the service is installed and it's now running. Executing "ps aux | grep ssh" again now shows a 3rd process "/usr/sbin/sshd -D" Now I need to configure my router and as @arkascha advised, I will try to change the default 22 port to something else. Meanwhile I have tried to connect to the local ip 192.168.0.192 using putty on port 22 from inside my network and this time the connexion opened, just that when using root and my kali password I get "Access denied" – faceoff Feb 14 '16 at 14:29
  • 1
    The recommended default setting for ssh servers is such, that only non-privileged accounts can access. So you should connect using your normal user account. Then, if required, you can use the `sudo` utility to gain higher privileges. – arkascha Feb 14 '16 at 14:32
  • About changing the port: to clearify this: stay with port 22 on the linux box, but on the router configure some non standard port like 50022 being forwarded to the internal port 22. – arkascha Feb 14 '16 at 14:33

0 Answers0