Posts

Showing posts from May, 2017

Add a user to a group

Image
Hello, recently I'm too busy to write the blog, sorry about that. Today I gonna tried to add my user to the group. Since I using the Samba server, I set some file can be accessed by specific people. So... let's start. First of all, if you use groups , you will get something like this edwinlai@edwinlai:~$ groups edwinlai adm cdrom sudo dip plugdev lpadmin sambashare  To create a new group : edwinlai@edwinlai:~$ sudo groupadd my_group Now we want to add a user into the group! Also, you can add user to multiple group at once. edwinlai@edwinlai:~$ usermod -a -G group user edwinlai@edwinlai:~$ usermod -a -G group1,group2,group3 user And if you know what is primary group , we can change use's primary group by this command: edwinlai@edwinlai:~$ usermod -g group user Now you can use groups to see the groups include the user edwinlai@edwinlai:~$ groups user Finally, we want to create a new user and add it to the group we want. edwinlai@edwinlai:~$ usera...

Setting up git SSH key on ubuntu

Image
Yeah~~ Long time no see guys~ These day I was porting code from one computer to others by git. If you are familiar with it please don't be too serious, I'm just new of it. The problem is that typing user name and the password wasted me lots of time. Hence, I try not to use http but ssh link to the gitlab. (At least I don't need to type the username!! Especially it's an e-mail !) So ... the tutorial  to make ssh work on ubuntu to gitlab is below. 1. Generate a SSH key for ur computer. ssh-keygen -t rsa -C "yourmail@mail.com" -b 4096 2. Copy the ras key to clip board , you can copy by urself or apt-get install xclip tool to do it. xclip -sel clip < ~/.ssh/id_rsa.pub 3. And then you just have to add the key to the git setting.      If you used gitlab as I do you can go setting --> Deploy key 4. Then you Named the key and paste the key to the text edit , AND! check the "write access allowed" below!   5. After saved yo...