Score:0

How can I ssh to my computer?

I have recently downloaded ubuntu server 20.04 to my desktop and it has no wireless connection. Is there a way to ssh from my laptop to my desktop PC which has ubuntu server in it? Both laptop(win10) and desktop(ubuntuserver20.04) are connected with an ethernet cable.

oemb1905 avatar
th flag
If you don’t know how to set up wpa supplicant manually, then your best bet is to hook up a USB Ethernet adapter and plug it into your LAN then ssh as per normal.
ICY Counter-Strike and League  avatar
@oemb1905 Well, the desktop has an ethernet port, but no wireless interface. I have connected both of them with an ethernet cable together. But I don't know what to do.
oemb1905 avatar
th flag
Connecting together won’t work - you need to get a USB to Ethernet adapter for the laptop and or manually set up wireless …
ICY Counter-Strike and League  avatar
Well the laptop has a port for ethernet but okay I get an USB to Ethernet adapter then
pasman pasmański avatar
mx flag
alternatively you may use any router and connect both computers to it
oemb1905 avatar
th flag
Oh you said it did not above - yeah if the laptop has an Ethernet port, then use that it should work unless it needs drivers in which case you need to use the USB adapter (which most have firmware embedded on device and hot plug).
ICY Counter-Strike and League  avatar
Please fully read my comment, I said I have connected both of them with an ethernet cable. The desktop has no connection to the internet only can connect by ethernet to my laptop. What should I do now?
oemb1905 avatar
th flag
Uh I read it, you are just not being consistent in your statements, so not possible to help you. Hope you get it sorted!
ICY Counter-Strike and League  avatar
Not consistent? I just said I have connected both of them with an ethernet cable and you tell me to get a USB to Ethernet adapter.
Score:1
cn flag
raj

If you have connected both your desktop and laptop with an Ethernet cable and did not set up any specific IP addresses, both machines probably use randomly assigned "autoconfiguration" IP addresses, ie. addresses from the range 169.254.x.x. You need to check on both machines what addresses they have.

On Windows machine, type the following in the CMD window:

ipconfig

You may also check the IP address from Windows GUI, but it is quite a lot of clicking in Windows 10 (it was easier in previous releases), it's just faster to do it from command line :). You will see the addresses for both interfaces (Ethernet and wireless).

On Linux machine, login on the text console and type:

ifconfig -a

You will see a lo interface (IP address 127.0.0.1) which you should just ignore - that is a "loopback" connection under which the machine is able to access itself - and another interface corresponding to your Ethernet adapter.

If both machines show IP addresses from the range 169.254.x.x, you are ready to connect (assuming the ssh server is running on your desktop - it should be active on Ubuntu Server by default, I guess). Note the IP address of your desktop and use it with a Windows ssh client. Windows 10 does include a ssh client in the OS (at last; with previous releases of Windows, you had to download a third-party client), so it should be enough to just type ssh [email protected] (where user is your username in Ubuntu and 169.254.a.b is the IP address of your Ubuntu machine) in CMD window to connect.

ICY Counter-Strike and League  avatar
Well, when I do ifconfig there isn't the same IP address there. 169.254.x.x isn't shown
raj avatar
cn flag
raj
@ICYCounter-StrikeandLeague There **can't** be the same address on both machines - there **must** be two different ones, but they must be from the same network. What addresses do you have on both your machines?
ICY Counter-Strike and League  avatar
Well, ipconfig windows shows 169.254.x.x but linux ifconfig ethernet part has nothing
raj avatar
cn flag
raj
@ICYCounter-StrikeandLeague Is the Ethernet device shown as "UP" at all in Linux?
ICY Counter-Strike and League  avatar
enp1s0: UP, so yes
ICY Counter-Strike and League  avatar
I don't see inet in enp1s0 but other interface has for example lo
raj avatar
cn flag
raj
@ICYCounter-StrikeandLeague try also `ip addr show`; if it doesn't show the address, try to restart the interface using `sudo ip link set enp1s0 down ; sudo ip link set enp1s0 up`. If it still doesn't help you can manually set a temporary IP address until you solve the issue. Use `sudo ip addr add 169.254.a.b/16 dev enp1s0`.
ICY Counter-Strike and League  avatar
Thank you for your support it now works
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.