{"id":25595,"date":"2024-02-29T14:19:09","date_gmt":"2024-02-29T14:19:09","guid":{"rendered":"https:\/\/linuxways.net\/?p=25595"},"modified":"2024-02-29T14:20:34","modified_gmt":"2024-02-29T14:20:34","slug":"install-configure-openssh-arch-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/arch\/install-configure-openssh-arch-linux\/","title":{"rendered":"How to Install and Configure OpenSSH on Arch Linux"},"content":{"rendered":"<p>To connect any operating system either Linux, Windows, or macOS remotely secure shell network protocol is primarily used. The prime use for accessing a system remotely is to manage infrastructure or to transfer files.<\/p>\n<p>The OpenSSH is the actual functionality of SSH protocol which is based on the client and server. It is used to securely send instructions to another computer over an unsecured network and provides a way to authenticate and encrypt connections between the devices. On Arch Linux, OpenSSH is normally pre-installed, but it can be installed if it is not pre-installed using Pacman.<\/p>\n<p><strong>Outline:<\/strong><\/p>\n<ul>\n<li><a href=\"#post-25595-_4csse3z33bqj\"><strong>Install OpenSSH on Arch Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-25595-_tuqfmbreazs\"><strong>Configure OpenSSH on Arch Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-25595-_3987irb8i52p\"><strong>Conclusion<\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-25595-_4csse3z33bqj\"><\/a><strong>How To Install OpenSSH on Arch Linux<\/strong><\/h2>\n<p>OpenSSH as mentioned above is pre-installed so to verify it you can use the query for OpenSSH package details using the Arch Linux default package installer:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> pacman <span class=\"re5\">-Qi<\/span> openssh<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"622\" height=\"347\" class=\"wp-image-25597\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-1.png 622w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-1-300x167.png 300w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/p>\n<p>If there is an error upon the execution of the query command then it means that OpenSSH is not installed on Arch so to install it execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> pacman <span class=\"re5\">-S<\/span> openssh<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"392\" class=\"wp-image-25599\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-2.png 626w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-2-300x188.png 300w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/p>\n<h2><a id=\"post-25595-_tuqfmbreazs\"><\/a><strong>How To Configure OpenSSH on Arch Linux <\/strong><\/h2>\n<p>To use the OpenSSH on Arch it needs to be activated first as by default it is not activated, so first check its status then enable it, and then after that start it:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl status sshd<br \/>\n<br \/>\n<span class=\"kw2\">sudo<\/span> systemctl <span class=\"kw3\">enable<\/span> sshd<br \/>\n<br \/>\n<span class=\"kw2\">sudo<\/span> systemctl start sshd<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"628\" height=\"370\" class=\"wp-image-25601\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-3.png 628w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-3-300x177.png 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/p>\n<p>Once the service is active and running, the system can be accessed remotely but for that, you need to find the IP address for the system and to IP address execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ip<\/span> a<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"636\" height=\"402\" class=\"wp-image-25605\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-4.png 636w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-4-300x190.png 300w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/p>\n<p>Now to connect to Arch Linux remotely simply use its IP address and hostname along with the SSH command, here for illustration I have accessed Arch from Debian 12:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ssh<\/span> USERNAME<span class=\"sy0\">@<\/span>IP_ADDRESS<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"301\" class=\"wp-image-25611\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-5.png 791w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-5-300x114.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-5-768x292.png 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/p>\n<p>Now if you want to close the connection for the remote system simply execute the<em> exit <\/em>command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">exit<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"169\" class=\"wp-image-25616\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-6.png 692w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-6-300x73.png 300w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/p>\n<p>On the contrary, if there are any port issues while accessing the remote system via OpenSSH then you can change the port number to any desired one and for that open the sshd configuration file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">nano<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>ssh<span class=\"sy0\">\/<\/span>sshd_config<\/div><\/div>\n<p>Here, first uncomment the port and then enter the desired port number:<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"631\" height=\"378\" class=\"wp-image-25622\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-7.png 631w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-7-300x180.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-7-501x300.png 501w\" sizes=\"auto, (max-width: 631px) 100vw, 631px\" \/><\/p>\n<p>Now to apply the changes reload the OpenSSH service of Arch using the <em>systemctl <\/em>utility:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl restart sshd<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"133\" class=\"wp-image-25629\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-8.png 630w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-8-300x63.png 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/p>\n<p>Now you can access Arch Linux remotely by using the custom port number given in the configuration file. Here the p flag is for the port number and for illustration I have accessed Arch Linux from Ubuntu:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ssh<\/span> <span class=\"re5\">-p<\/span> <span class=\"nu0\">80<\/span> USERNAME<span class=\"sy0\">@<\/span>IP_ADDRESS<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"841\" height=\"283\" class=\"wp-image-25638\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-9.png 841w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-9-300x101.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25595-9-768x258.png 768w\" sizes=\"auto, (max-width: 841px) 100vw, 841px\" \/><\/p>\n<p><strong>Note: <\/strong>SSH is a network protocol that enables secure remote login from one system to another. It provides strong password authentication and encrypted data communication over an insecure network. Whereas OpenSSH is an open-source implementation of SSH that includes both client and server components making it more secure than SSH.<\/p>\n<h2><a id=\"post-25595-_3987irb8i52p\"><\/a><strong>Conclusion <\/strong><\/h2>\n<p>OpenSSH is most of the time pre-installed on Arch Linux but its service is not active, if OpenSSH is not installed on Arch then it can be installed via Pacman. Furthermore, to access any operating system remotely you need to have its IP address and username. Similarly, you can also set a specific port for remote connection.<\/p>","protected":false},"excerpt":{"rendered":"<p>OpenSSH is most of the time pre-installed on Arch Linux but its service is not active, if OpenSSH is not installed on Arch then it can be installed via Pacman.<\/p>","protected":false},"author":113,"featured_media":25824,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1055],"tags":[],"class_list":["post-25595","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arch"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=25595"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25595\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/25824"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=25595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=25595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=25595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}