본문 바로가기

Linux Distributions

How to Install SSH Server on Ubuntu

728x90
반응형

How to Install SSH Server on Ubuntu

To install an SSH server on Ubuntu, you can follow these steps:

1. Update package lists

Open a terminal on your Ubuntu system and run the following command to update the package lists:

sudo apt update

2. Install the SSH server package

Run the following command to install the SSH server package called openssh-server:

sudo apt install openssh-server

3. Configure SSH server (optional)

By default, the SSH server should work out of the box. However, if you want to customize the SSH server configuration, you can edit the /etc/ssh/sshd_config file using a text editor of your choice. For example:

sudo nano /etc/ssh/sshd_config

Make any necessary configuration changes and save the file.

4. Start the SSH server

Once the installation is complete, the SSH server should start automatically. If it doesn't, you can start it manually using the following command:

sudo systemctl start ssh

5. Enable the SSH server to start on boot (optional)

If you want the SSH server to start automatically every time the system boots, run the following command:

sudo systemctl enable ssh

 

Now your Ubuntu system has an SSH server installed and running. You can connect to it from another computer using an SSH client. Use the following command in the terminal of the client machine:

ssh username@server_ip_address

 

Replace username with a valid user on the Ubuntu system, and server_ip_address with the IP address of the Ubuntu system. Enter the password for the user when prompted, and you should successfully establish an SSH connection to the Ubuntu server.

 

728x90
반응형