24

I want to use my home pc at my office, without literally taking it to my office. I would like to have a simpler solution than TeamViewer, cause I'm usually using Live distros at my work place, so SSH would be a great solution if it actually can do the same job as "Remote Desktop".

If that isn't possible, at least give me the commands to use terminal of my home computer from my office computer.

waldyrious
  • 2,207
Xamidovic
  • 720

3 Answers3

17

I normally access my home PC through SSH (no GUI).

To do that, you should first config your router in order to grant SSH port forwarding. You can usually access the router configuration pages by looking up the IP of the gateway (Connection Information > Default Route). Most modern routers have presets for configuring several applications, including SSH. If you need to forward the port manually, though, set it so that any incoming connections through port 22 will be routed to the local IP of your home computer.

Then, you need to install the SSH deamon on your home PC:

sudo apt-get install SSH

After this, you'll be able to access from client PCs with a simple:

ssh user@IP

where IP is the IP of your home PC. You may want to make it "static", and for this I can suggest to configure a host on http://www.no-ip.com and then install noip2 on Ubuntu.

waldyrious
  • 2,207
jasmines
  • 11,311
1

If you do not have a static IP, nor a public network IP, and have a personal server, you can try : https://github.com/fatedier/frp .
It can build a access node as a proxy center. Home PC connect to the frp, and Office PC connect to the frp, the frp will transport Office PC network packages to Home PC.

0

Sample TP-Link Archer VR2800 setup

The "hard" part is setting up the router.

For example, after I got the Internet to work on my TP-Link as mentioned at: https://www.youtube.com/watch?v=7vqVVlEFnV4 then I had to visit http://192.168.1.1 login and go:

  • Advanced
  • NAT Forwarding
  • Virtual servers
  • Add

My sample screenshot is forwarding external port 80 to my computer with internal IP 192.168.1.123 port 3000 as it is a web server.

For SSH you would likely keep it 22 external to 22 internal.

enter image description here

Then I fixed my home computer to always have that same IP with a static IP reservation:

  • Advanced
  • Network
  • LAN Settings
  • Address reservation

and I fix the IP of my computer to be 192.168.1.123. I identify the computer using its MAC address, which is a unique hardcoded hardware identifier of each network interface.

How to find your MAC address was asked at: https://superuser.com/questions/164426/how-can-i-see-my-mac-address-on-ubuntu

enter image description here

Then you just proceed to normally setup a the server For an SSH on Ubuntu 24.10 you'd simply do:

sudo apt install openssh-server

You can now first test that the server is accessible and working internally by using the internal IP from another computer connected to the home network:

ssh username@<internal-ip>

in my case:

ssh ciro@192.168.1.123

Next you want to determine your public IP address: Command for determining my public IP?

and then finally you can just:

ssh username@<external-ip>

say:

ssh ciro@1.2.3.4

You can then test this out by using a second computer or cell phone, disconnect it from your home Wi-Fi and use mobile Internet.

This is how my router looks like, he's cute:

enter image description here