InstantSSH -- Couldn't create SSH key when connected as InstantSSH user

  • Hi - i wanna create a ssh key - but it fails:
    seems like a permission issue, not sure - am i doing smth wrong?

    Code
    1. vu2008@server:~/web/htdocs/current$ ssh-keygen
    2. Generating public/private rsa key pair.
    3. Enter file in which to save the key (/var/www/virtual/host.tdl/.ssh/id_rsa):
    4. Could not create directory '/var/www/virtual/host.tdl/.ssh': Operation not permitted
    5. Enter passphrase (empty for no passphrase):
    6. Enter same passphrase again:
    7. Saving key "/var/www/virtual/host.tld/.ssh/id_rsa" failed: No such file or directory

    Debian Stretch 9.0,
    InstantSSH Version 5.0.1


    Thanks!

    Edited once, last by aaroniker ().

  • @aaroniker


    This is the expected behavior. Customers are not allowed to write into the root of their Web folders when the Web folders protection is active (immutable bit).


    You must create the SSH key on your own computer, or specify a writable path such as /var/www/virtual/host.tdl/htdocs/.ssh and once done, add the key through the InstantSSH interface.


    Note that usage of the i-MSCP virtual user $HOME/.ssh directories is deprecated since InstantSSH plugin version 4.0.0. Since that version, customer SSH keys are stored in the /etc/InstantSSH directory (centralized storage).


    We don't allow customers to provide their own InstantSSH key outside of the plugin interface for security reasons. An SSH key can contains more than the key itself, such as a command to execute and so on. All this is configurable through the plugin configuration file:

    and of course, the customer must have sufficient permissions.


    The InstantSSH plugin is a great piece of software which is highly configurable. However it is a bit complex and you'll have to learn a bit before being able to manage it correctly.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206