Hot answers tagged

67 votes

Start SSH automatically on boot

Have you tried just simply setting sudo systemctl enable ssh ? That's how I have my ssh set to run at start up. ****I'm leaving in the above part of the answer in case it's helpful for others who ...
54 votes

How to setup a restricted SFTP server on Ubuntu?

Step 1 : Install OpenSSH package if not installed sudo apt-get install openssh-server Step 2 : Create separate group for SFTP users. sudo addgroup ftpaccess Step 3 : Edit /etc/ssh/sshd_config ...
  • 541
54 votes

Error `could not load host key` when trying to recreate SSH host keys

None of the answers above worked for me. I fixed my ubuntu system by doing the following: /usr/bin/ssh-keygen -A
  • 641
41 votes

What's the difference between ssh and openssh packages?

Ok... Simple: Let's ask the package manager aptitude search ssh. You will get a rather large output, but I'll pick a few for you: i A openssh-client - secure shell (SSH) client, ...
  • 2,472
35 votes

key_load_public: invalid format with scp or git clone on Ubuntu 15.10

Check the file /Users/alexzeitler/.ssh/id_rsa. What is there? How did it get there? It should be your private RSA key, isn't it? And is there something in /Users/alexzeitler/.ssh/ Is it ...
  • 6,435
34 votes

Key based SSH login that requires both key AND password

There are two ways to configure ssh to require both a public key and a password or passphrase. The difference between the password and the passphrase: The password in this context is the password ...
  • 29.7k
32 votes

How do I setup SSH key based authentication for GitHub by using ~/.ssh/config file?

Here is а short manual how to setup SSH key based authentication for GitHub. 1. Install the openssh-client if it is not already installed, and of course git: sudo apt update && sudo apt ...
  • 28.8k
31 votes

How can I reconnect to a ssh session after a broken pipe?

While you can't reattach to a broken SSH session, you can reparent the process running inside SSH – functionally equivalent to what you want. Instructions In your case, you would take over the apt-get ...
  • 5,881
31 votes

ssh: automatically accept keys

I'm a bit late with this response, but the sensible way would be to do a ssh-keyscan on the new machine before you run the uptime gathering. ssh-keyscan <newhost> >> ~/.ssh/known_hosts ...
  • 467
27 votes

How can I access my Ubuntu phone over ssh?

With the official final release Ubuntu for Phones ships the "android-gadget-service" tool with which you can manage adb, mtp, USB tethering and ssh. Connect your device via USB, enable Developer Mode ...
  • 412
27 votes

Where is the .ssh directory?

The file is not created by the installation, but upon the first use of ssh or ssh-keygen. If it is not there, there is nothing to worry about. You can simply create it using mkdir ~/.ssh/.
  • 6,435
24 votes

Enabling and disabling sshd at boot via systemd

sshd service is originally written as ssh.service and sshd.service is set as alias name. Check out the last line of following output. arryph@localhost:~$ systemctl cat sshd.service # /lib/systemd/...
  • 609
23 votes

apt-get dependency issue Open-SSH Client

Just remove these packages to let you use apt for other packages. Execute this commands in terminal. sudo apt-get remove openssh-server openssh-client --purge && sudo apt-get autoremove &&...
22 votes

How to disable autostart of SSHD in Ubuntu 15.04

The command systemctl disable ssh did it for me. @Jakuje: Thanks for giving me the idea.
  • 481
21 votes

How to solve 'Connection refused' errors in SSH connection?

open the file of ssh config: sudo nano /etc/ssh/ssh_config find the port #port 22 uncomment (remove the #) the port option then save the file by ctrl + x and restart your service sudo service sshd ...
21 votes

How to generate Openssl .pem file and where we have to place it

First you need to upload public key to the server you are willing to connect to, public key is in .pub file: Example: # ssh-copy-id -i ~/ root@ After this it should be ...
  • 5,391
20 votes

How can I access my Ubuntu phone over ssh?

To activate ssh access entirely over wifi, without developer mode on the phone, without any special tooling on your computer and without using USB: If you don't already have an ssh keypair, type ssh-...
  • 15.3k
20 votes

What is the difference between PGP and RSA protocols?

Using a car analogy: PGP is a car OpenPGP is the design for the PGP car GnuPG is another car using the same design RSA is a diesel engine, and other engines are available SSH isn't a car at all. But ...
  • 188k
18 votes

What does 'without password' mean in sshd_config file?

Actually this setting does pretty much nothing if you are using PAM authentication. At the bottom of the sshd_config configuration file you will find: # Set this to 'yes' to enable PAM authentication,...
  • 572
18 votes

Is possible to upgrade openssh-server OpenSSH_7.6p1, to OpenSSH_8.0p1?

To upgrade OpenSSH from 7.6 to 8.9 on Ubuntu 18.04 (bionic), I followed the instructions given here: How to Install OpenSSH 8.0 Server from Source in Linux. The version I started with: $ ssh -V ...
  • 281
17 votes

Difference between Software Selection Servers

The term "server" means a piece of software that offers a service to clients. A server usually waits for a client to contact it, and then sends the reply to the client. For further ...
  • 13.9k
16 votes

How to enable SSH on boot in Ubuntu MATE

I think the command you're looking for is: sudo systemctl enable ssh (Note the letter "l" at the end of systemctl, rather than the number "1" at the end of systemct1 as you currently have it in the ...
  • 1,423
15 votes no version information available (required by ssh)

Have you installed a non-Ubuntu version of OpenSSL from somewhere? The Ubuntu version of OpenSSL has some additional patches installed that are not included if you get your version of OpenSSL from ...
  • 2,100
14 votes

ssh: connect to host port 22: Connection refused

Use ssh with port option: ssh root@ -p 2222 Edit This issue happens when you change your ssh server port to a non standard port like 2222 in ssh config file. (/etc/ssh/sshd_config --> ...
13 votes

SSH Server cannot be found - Even though installed

It is possible that the service is not called sshd. you can try this command systemctl -l --type service --all|grep ssh On my ubuntu 18.04, the service is called ssh by default. in my case, I did ...
12 votes

SSH error: Permission denied, please try again

This is not exact answer for this question. But In my case, there was redundant lines. (there were same line twice) PermitRootLogin yes and also AllowUsers otheruser You should add 'root' user to ...
  • 221
12 votes

Limit SFTP user access to specified directory

Settings for /etc/ssh/sshd_config Subsystem sftp internal-sftp -f AUTH -l VERBOSE UsePAM yes Match group sftp ChrootDirectory %h ForceCommand internal-sftp AllowTcpForwarding no create group ...
  • 10.2k
11 votes

Why do I've two entries per server in known_hosts file?

You have two entries because one is by domain and the other by IP address, so your example: |1|wwwwwwwwwwwwwww=|wwwwwwwwww= ecdsa-sha2-nistp256 AAAAAAAAAA+AAAAA= |1|vvvvvvvvvvvvvvv=|vvvvvvvvvv= ecdsa-...
11 votes

Error `could not load host key` when trying to recreate SSH host keys

sudo ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N 'myverylongpasswordhere' -b 4096 -t rsa recreates me the keys. but, after restarting the server, i recieve could not load host key: /etc/ssh/...
  • 28.2k
10 votes

Not able to change ssh port on Ubuntu 18.04.1 LTS

The file that you edited, /etc/ssh/ssh_config is the global ssh client configuration file - changing the port there will change the port which the ssh (and scp) programs try to connect to. To change ...

Only top scored, non community-wiki answers of a minimum length are eligible