To revert the changes, remove the last line (the most recently added key) from the /home/bitnami/.ssh/authorized_keys file or restore the old authorized_keys file: $ cp /home/bitnami/.ssh/authorized_keys.bak /home/bitnami/.I am trying to access & configure the ‘database’ parameter of a postgresql service using GET/PATCH and unable to do either. The new user should now be able to access the machine by logging in as bitnami. In this example, the new user’s public key is assumed to be in USERNAME.pub: $ cat USERNAME.pub > /home/bitnami/.ssh/authorized_keys Perform this step carefully to ensure that existing keys are not modified or deleted, as an error could result in you losing all SSH access to the server. Step 2 (Option B): Allow the new user to log in using the bitnami accountīack up your list of authorized keys: $ cp /home/bitnami/.ssh/authorized_keys /home/bitnami/.ssh/authorized_keys.bakĪdd the new user’s public key to the authorized_keys file. To delete the new user account, execute the following command: $ sudo userdel USERNAME -fĬonfirm that the account has been successfully removed by executing the command below: $ id USERNAME To allow the new user to execute commands as the root user, add the new user account to the bitnami-admins group, by executing the following command when logged in as the bitnami user: $ sudo usermod -aG bitnami-admins USERNAME To grant other users access to the server using this same account, repeat the last step and add each user’s public key to the authorized_keys file. In this example, the user’s public key is assumed to be in USERNAME.pub: $ cat USERNAME.pub > /home/USERNAME/.ssh/authorized_keys $ sudo cp -rp ~bitnami/.profile ~USERNAME/Īdd the content of the user’s public key file to the /home/USERNAME/.ssh/authorized_keys file. $ sudo cp -rp ~bitnami/.bashrc ~USERNAME/ As before, replace the USERNAME placeholder with the username for the new account. This will create an alias user for the bitnami account, giving it the same privileges.Ĭonfigure SSH access for the new user account, by copying the /home/bitnami/.ssh directory to the new user’s home directory. $ sudo useradd -s /bin/bash -o -u `id -u` -g `id -g` USERNAME Replace the USERNAME placeholder with the username for the new account. Log in to the server console as the bitnami user.Ĭreate a new user account that will share the same user privileges as the bitnami user. Step 2 (Option A): Create a separate account for the new user ![]() Option B: Allow the new user to log into the server using the existing bitnami user account.Option A: Create a separate account for the new user (recommended).This example assumes that the public key file is named USERNAME.pub. The user should share this with you to gain access to the server. The user will need this to access the server.Ī public key. This should not be shared with anyone else. The generated key pair will contain two files:Ī private key. For instructions on how to use ssh-keygen, refer to this page. For instructions on how to use PuTTYgen, refer to this page. To generate a new SSH key pair, use PuTTYgen (Windows) or the ssh-keygen command (Linux and Mac OS X). If the person to whom you wish to give access doesn’t have a private/public key pair yet, he or she must first generate this key pair. Give SSH access to another person, such as a customerįollow the steps below: Step 1: Create private/public keys for the new account ![]()
0 Comments
Leave a Reply. |