Non-root user account.<\/li>\n<\/ul>\nCreating the new user<\/h3>\n
Note that you can use this method with any account, there is no explicit need for a new user.<\/p>\n
Creating a new user within Ubuntu is very straightforward. Type the following command.<\/p>\n
adduser username\r\n<\/code><\/pre>\nThe above command created a fully functional user titled\u00a0username<\/strong>.<\/p>\nCopying the SSH key to the new user<\/h3>\n
In Ubuntu, each user has a\u00a0.ssh<\/code>\u00a0directory within their home directory. We will be copying the SSH key from the\u00a0root<\/strong>\u00a0user’s SSH directory to the new user’s directory.<\/p>\nMore than likely, the\u00a0.ssh<\/code>\u00a0directory doesn’t exist, let’s go ahead and create that directory.<\/p>\nsudo mkdir \/home\/username\/.ssh\r\n<\/code><\/pre>\nNow we can copy the SSH key files from\u00a0root<\/strong>\u00a0to\u00a0username<\/strong>.<\/p>\nsudo cp -rf \/root\/.ssh\/* \/home\/username\/.ssh\/\r\n<\/code><\/pre>\nBefore we can use the SSH key, we\u00a0must<\/em><\/strong>\u00a0make sure we change the user rights to\u00a0username<\/strong>.<\/p>\nchown -R username:username \/home\/username\/.ssh\r\n<\/code><\/pre>\nCongratulations! If you followed the above commands correctly, you will now be able to login to\u00a0username<\/strong>\u00a0with your SSH key.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[242],"manual_kb_tag":[491],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/3000"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=3000"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/3000\/revisions"}],"predecessor-version":[{"id":3001,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/3000\/revisions\/3001"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=3000"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=3000"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=3000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}