Sunday, March 26, 2023

How to install a ssh server on Manjaro Linux and transfer files over a local network

Install the ssh server if it hasnt been already:

sudo pacman -S openssh
Verify that the openssh service is running
sudo systemctl status sshd.service
If it isnt running enable and start it:
sudo systemctl enable sshd.service
sudo systemctl start sshd.service
The next thing you'll want to do is add a firewall rule to allow connections to the server over the network. By default it comes over port 22. So we'll add a new firewall rule:
sudo ufw allow 22/tcp
Now you should be able to connect to your computer from the ip address. You can also connect to it using the name of the computer.
ssh username@123
where username is your username on the computer and 123 is the ip address. you can also just type the name of the computer and .local. It'll give you a warning by default, just type yes.if you're really concerned about security you can always use Google to find a guide about locking things down, but I wouldnt worry much since if your ISP configured things properly no one would be able to accesss your computer from outside anyways. So to connect to my thinkpad which is on the same network Id type.
ssh adrien@thinkpad.local
Note: if the computer is local on the network and you dont append .local to the end it'll throw an error because it wont be able to resolve it. If the computer isnt local you'll have to figure out its' ip address from the outside network. Though you'll probably have to configure something with your router to let connections in if the computer is at your home, a lot of ISPs block connections from outside far as I know.

Unrelated Note: If you want to transfer files over ssh on a local network and it's assumed you're running a version of Manjaro linux(or Ubuntu) with the xfce Desktop Environment you can type the following in the address bar of thunar:
ssh://username@computername.local
It'll prompt you with a dialogue box to login to the computer via the gui and you can transfer files to it just as you would if the drive was on your computer.



No comments:

Post a Comment

A list of some software I installed on Arch Linux

This is a list of packages I installed on Arch Linux. When you install Arch Linux you get to choose whatever you want to install, though som...