1. Install OpenSSH server
sudo apt-get install openssh-server openssh-client
2. Create a personal public key and private key
Under the default user's home directory path, run the following command to follow the prompts to create the public and private keys
SSH-KEYGEN-T RSA
Generate 2048-bit by default, or you can create a public and private key by using the following command if you need to increase the security level
Ssh-keygen-t rsa-b 4096
By default, the public and private keys are saved in the ~/.ssh directory, as follows:
Id_rsa id_rsa.pub known_hosts
3. Install the GIT server
sudo apt-get install Git-core
4. Configure the GIT server
Create a GIT server administrative user
sudo useradd-m gitsudo passwd git
Create a git repository storage directory
sudo mkdir/home/git/repositories
Set git repository permissions
sudo chown git:git/home/git/repositoriessudo chmod 755/home/git/repositories
Initialize Global Settings
git config--global user.name "myname" git config--global user.email "[Email protected]"
5. Install Python Setup Tool
sudo apt-get install Python-setuptools
6. Get and install Gitosis
Cd/tmpgit clone Https://github.com/res0nat0r/gitosis.gitcd Gitosissudo python setup.py install
7, Configuration Gitosis
CP ~/.ssh/id_rsa.pub/tmpsudo-h-u git gitosis-init </tmp/id_rsa.pubsudo chmod 755/home/git/repositories/gitosis-ad Min.git/hooks/post-update
8, Management gitosis configuration
CD ~git clone [email protected]: User name/gitosis-admin.gitcd gitosis-admin/
Here to note, how to still be from native clone to native then need to hit Git clone/path/gitosis-admin.git/
Build a git server