On the SSH server, forward the port you want to use to the network IP on the router.
Example:
Forward port 22 to 192.168.0.2 (PC IP) on the router of ssh server.
Now if you know the "internet" IP you can simply:
A more secure way would be to use some arb port on the ssh server, like port 6321 for example. In /etc/ssh/sshd_config you can change the default port number from 22 to whatever you want and then just forward that port on your router. Now on the client:
The biggest challenge will be to get your IP each time. You can setup
dynDNS or similar service and use
ddclient in a cron job to update your IP to your dynamic DNS hostname.
On the client you will then use:
Code:
ssh user@dyn_dns_hostname:port_number
The most secure way would be to just use host keys, but I never use this since there is no need for this on my LAN so I only have a basic grasp of this and cannot give more intel than a simple Google search.
EDIT:
Stupid smiley, had to CODE tag the commands...