Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/feed-rss2.php on line 8
Using your SSH key to login to non-root users – AKLWEB HOST LLC Support Center https://support.aklwebhost.com Thu, 09 Jan 2020 21:16:03 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.4 Using your SSH key to login to non-root users https://support.aklwebhost.com/knowledgebase/using-your-ssh-key-to-login-to-non-root-users/ https://support.aklwebhost.com/knowledgebase/using-your-ssh-key-to-login-to-non-root-users/#respond Thu, 09 Jan 2020 21:16:03 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3000 AKLWEB HOST provides a feature that allows you to pre-install SSH keys upon creating a new instance. This allows you to access the server’s root user, however, the key will not work out of the box with newly created non-root users. In this tutorial, I will be showing you how to use your pre-installed SSH key with newly created users.

Requirements

  • A AKLWEB HOST instance with Ubuntu installed. This guide will likely work for all current Linux distributions, I am using Ubuntu 14.04.
  • SSH key added from your AKLWEB HOST control panel (Guide can be found here)
  • Non-root user account.

Creating the new user

Note that you can use this method with any account, there is no explicit need for a new user.

Creating a new user within Ubuntu is very straightforward. Type the following command.

adduser username

The above command created a fully functional user titled username.

Copying the SSH key to the new user

In Ubuntu, each user has a .ssh directory within their home directory. We will be copying the SSH key from the root user’s SSH directory to the new user’s directory.

More than likely, the .ssh directory doesn’t exist, let’s go ahead and create that directory.

sudo mkdir /home/username/.ssh

Now we can copy the SSH key files from root to username.

sudo cp -rf /root/.ssh/* /home/username/.ssh/

Before we can use the SSH key, we must make sure we change the user rights to username.

chown -R username:username /home/username/.ssh

Congratulations! If you followed the above commands correctly, you will now be able to login to username with your SSH key.

]]>
https://support.aklwebhost.com/knowledgebase/using-your-ssh-key-to-login-to-non-root-users/feed/ 0