محمد حسین ابراهیم زاده
محمد حسین ابراهیم زاده
خواندن ۱ دقیقه·۸ ماه پیش

connect to an Ubuntu server via SSH without a password

To connect to an Ubuntu server via SSH without a password, you need to set up SSH key-based authentication. The steps are:

  1. Generate an SSH key pair on your local machine:
ssh-keygen

This will create a public key (id_rsa.pub) and a private key (id_rsa) in the ~/.ssh/ directory.

  1. Copy the public key to the remote Ubuntu server:
ssh-copy-id remote_username@server_ip_address

This will append the public key to the ~/.ssh/authorized_keys file on the remote server.

  1. Disable password authentication on the remote server by editing the /etc/ssh/sshd_config file:
sudo nano /etc/ssh/sshd_config

Find the lines:

PasswordAuthentication yes ChallengeResponseAuthentication yes

and change them to:

PasswordAuthentication no ChallengeResponseAuthentication no

Then save the file and restart the SSH service:

sudo systemctl restart ssh ```[1][3][5] After completing these steps, you should be able to log in to the remote Ubuntu server using SSH without entering a password.[1][2][3]


sshubuntulinux
استراتژی، بازاریابی،کارآفرینی،فناوری اطلاعات
شاید از این پست‌ها خوشتان بیاید