There is a common case that multiple users use the same Linux server account, but they have different github accounts and their own repos. How to get a solution for this problem?
Given you have already configured an active github account (Alice) on the server with all global git and ssh settings done. We treat Alice as the main account.
Now configuring the ssh settings. We generate one more RSA key pairs.
ssh-keygen -t rsa -C "hello world"
When choosing the save path, be sure to save the file to a new name, e.g. id_rsa_bob
.
Then we add the private key to ssh settings.
ssh-agent bash
ssh-add id_rsa_bob
$ssh-add -l
will show the accepted private keys list.
Also, add id_rsa_bob.pub
to your github ssh key list.
Next, we write the ~/.ssh/config
file:
# git@github.com:Alice
Host github.com
User Alice
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
# git@github.com:bob
Host github-bob.com
User bob
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_bob
Make sure to give the file a proper authority:
chmod 600 ~/.ssh/config
Alice, as the main user, do not need to change anything. Bob, however, consider he clone a repo gene-player
from his github. Now he need to set the repo’s config file.
git config user.name "bob"
git config user.email email "bob@gene-player.com"
git config remote.origin.url "git@github-bob:bob/gene-player.git"
Note that we need to modify the remote.origin.url, replacing the original domain name “github.com” to “github-bob” as what we set the Host
variable in ~/.ssh/config
.
Now Bob can play with the repo.
Updated 2019-01-24
When porting CESM onto Prof. YTQ’s account on SAS (School of Atmospheric Sciences) Computing Platform, we met a bunch of problems on dependency. We highly suspect the administrator did not use the identical compiler to build all libs. Thus we tried to build our own dependencies using exactly the same compiler.
While building the NetCDF fortran lib to bundle into the C lib, in configuring, we met the problem:
configure: error: cannot compute sizeof (off_t)
We are using the configuring command:
./configure --prefix=/wind1/home/qiaoyt/soft/netcdf-4331-intel15/ LDFLAGS="-L/wind1/home/qiaoyt/soft/netcdf-4331-intel15/lib" CPPFLAGS="-I/wind1/home/qiaoyt/soft/netcdf-4331-intel15/include" FC=ifort
It’s quite strenge because the sizeof any type of variable is 0 in the configuring output. I suspect the configure utility cannot locate the C lib correctly, so I added the environmental variable for LD_LIBRARY_PATH
in ~/.bashrc
:
export LD_LIBRARY_PATH=$LIB_NETCDF:$LD_LIBRARY_PATH
The configure utility passed after source the bashrc. It seems to be a bug of the configure utility in NetCDF-fortran lib to locate the C lib.
The model was successfully ported after we re-built every lib with the identical compiler.
Updated 2019-01-10
Wenxiu Zhong met PopLatLon error:
ls: cannot access map_*: No such file or directory (0) create_rmpPopFileName: file not recognized/found: map_gx1v6_to_1x1d_bilin_da_100716.nc (0) create_rmpPopFileName: dir searched: ./
This is actually the system cannot find the pop remap weight file. The file info can be found from the NCL official site, which is actually downloaded from the CESM official svn site.
After downloaded the files, export related environmental variable in ~/.bashrc
:
export NCL_POP_REMAP=$DIR_TO_POP_REMAP_FILE
source ~/.bashrc
and re-run the script.
Updated 2018-12-31