At the same time, you also need to delete the IP key (they are stored separately): ssh-keygen -R 127.0.0.1.
The server key is stored in / etc / ssh / ssh_host_rsa_key and /etc/ssh/ssh_host_rsa_key.pub. They can be:
a) copy the old server to the new one.
b) generate with ssh-keygen. No password is required (i.e. empty). The password with the password ssh-server can not use.
Note, if you are cloning a server (for example, in virtual machines), then the server’s ssh-keys need to be regenerated.
It is better to remove old keys from know_hosts, otherwise ssh will swear at the duplicate key.
Transferring files to the server can sometimes be tiring. In addition to messing with sftp and other strange things, ssh provides us with the scp command, which performs the copying of a file through an ssh session.
scp path / myfile firstname.lastname@example.org: / full / path / to / new / location /
You can also back:
scp email@example.com: / full / path / to / file / path / to / put / here
Fish warning: Despite the fact that mc can do a ssh connection, copying large files will be very painful, because fish (the mc module for working with ssh as with virtual fs) is very slow. 100-200kb – the limit, then begins the test of patience. (I remembered my very early youth, when not knowing about scp, I copied ~ 5GB via fish in mc, it took a little more than 12 hours on FastEthernet).
Ability to copy cool. But I want to “save as” – and immediately to the server. And in the graphic mode to copy not from a special program, but from any familiar one.
So, too, you can:
Theory: the fuse module allows you to “export” file system requests from the kernel back to the userspace to the appropriate program. This makes it easy to implement pseudo-file systems. For example, we can provide access to a remote system via ssh so that all local applications (with a few exceptions) will not suspect anything.
Actually, the exception: O_DIRECT is not supported, alas (this is not a sshfs problem, this is a fuse problem in general).
Usage: install the sshfs package (it will bring fuse itself).
Actually, an example of my script that mounts desunote.ru (located on my home computer – it shows pictures in this article) to my laptop.