└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # how to ssh into linux machine 2 | 3 | ## step one 4 | 5 | installing the openssh package in case its not installed 6 | 7 | this step will depend on your linux distribution for me its arch 8 | 9 | ``` 10 | sudo pacman -Syy 11 | sudo pacman -S openssh 12 | ``` 13 | 14 | ## step two 15 | 16 | editing configuration file with nano 17 | 18 | if you dont have nano installed just run `sudo pacman -S nano` 19 | then open the config file in the etc directory 20 | 21 | ``` 22 | sudo nano /etc/ssh/sshd_config 23 | ``` 24 | 25 | in the nano editor uncomment `port 22` remove 22 and write port you like 26 | or leave at 22 its not recommended ! 27 | 28 | ## step three 29 | 30 | enabling the ssh service on startup and starting it 31 | 32 | ``` 33 | sudo systemctl enable sshd.service 34 | sudo systemctl start sshd.service 35 | ``` 36 | 37 | ## step four 38 | 39 | get your ip address for the machine you are trying to ssh into 40 | by running the command `ip addr` 41 | 42 | ## step five 43 | 44 | from any other linux you can connect by simply typing the ssh command with 45 | the user@ and the port of the machine you want to ssh into 46 | 47 | ``` 48 | ssh -v user@ -p 49 | ``` 50 | 51 | ## final step 52 | 53 | like and follow or star this repository 💙 54 | --------------------------------------------------------------------------------