Information Technology Reference
In-Depth Information
# Guest OS (Ubuntu 12.04)
# Commands executed by peter user
$ cp /home/peter/.ssh/id_rsa.pub /var/tmp/peter.pub
If Peter works on other machine he has to find a way for sending his public key to
administrator. He can use email, ftp, removable media (such as flash memory), and so
forth.
Peter's work is done for now. You can log him out:
# Guest OS (Ubuntu 12.04)
# Command executed by peter user
$ exit
Granting SSH access with authorized_keys file
We want to allow Peter access to the git account over SSH. This is done with public
key file. I will assume that Peter's public key is stored in /var/tmp/peter.pub .
We want to grant SSH access to the account named git. The configuration file that
defines who can open ssh connection to this account is named /home/git/.ssh/
authorized_keys .
First, you have to create a /home/git/.ssh/authorized_keys file using
the following commands:
# Guest OS (Ubuntu 12.04)
# Commands executed by vagrant user
$ sudo su
# mkdir /home/git/.ssh
# touch /home/git/.ssh/authorized_keys
# chown -R git:git /home/git/.ssh
# chmod 700 /home/git/.ssh
# exit
To grant access you have to append Peter's key to the /home/git/.ssh/au-
thorized_keys file of the git account. Here is the command that the administrator
can use to accomplish this:
Search WWH ::




Custom Search