1. 설치에 앞서 패키지 인덱스를 업데이트합니다.

1
2
3
4
5
6
7
8
$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Fetched 306 kB in 3s (86.4 kB/s)
Reading package lists... Done
 
cs



2. apt-get을 통해서 vim을 설치합니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$ sudo apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  vim-runtime
Suggested packages:
  ctags vim-doc vim-scripts vim-gnome-py2 | vim-gtk-py2 | vim-gtk3-py2 | vim-athena-py2 | vim-nox-py2
The following NEW packages will be installed:
  vim vim-runtime
0 upgraded, 2 newly installed, 0 to remove and 90 not upgraded.
Need to get 6,199 kB of archives.
After this operation, 30.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim-runtime all 2:7.4.1689-3ubuntu1.2 [5,164 kB]
Get:2 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim amd64 2:7.4.1689-3ubuntu1.2 [1,036 kB]
Fetched 6,199 kB in 2s (2,685 kB/s)
Selecting previously unselected package vim-runtime.
(Reading database ... 213928 files and directories currently installed.)
Preparing to unpack .../vim-runtime_2%3a7.4.1689-3ubuntu1.2_all.deb ...
Adding 'diversion of /usr/share/vim/vim74/doc/help.txt to /usr/share/vim/vim74/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim74/doc/tags to /usr/share/vim/vim74/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:7.4.1689-3ubuntu1.2) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a7.4.1689-3ubuntu1.2_amd64.deb ...
Unpacking vim (2:7.4.1689-3ubuntu1.2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up vim-runtime (2:7.4.1689-3ubuntu1.2) ...
Setting up vim (2:7.4.1689-3ubuntu1.2) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
 
cs



3. vim 버전을 확인합니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +tag_binary
+arabic          +file_in_path    +mouse_sgr       +tag_old_static
+autocmd         +find_in_path    -mouse_sysmouse  -tag_any_white
-balloon_eval    +float           +mouse_urxvt     -tcl
-browse          +folding         +mouse_xterm     +terminfo
++builtin_terms  -footer          +multi_byte      +termresponse
+byte_offset     +fork()          +multi_lang      +textobjects
+channel         +gettext         -mzscheme        +timers
+cindent         -hangul_input    +netbeans_intg   +title
-clientserver    +iconv           +packages        -toolbar
-clipboard       +insert_expand   +path_extra      +user_commands
+cmdline_compl   +job             -perl            +vertsplit
+cmdline_hist    +jumplist        +persistent_undo +virtualedit
+cmdline_info    +keymap          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       -python          +vreplace
+cscope          +lispindent      +python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            -ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xsmp
+emacs_tags      -mouseshape      +startuptime     -xterm_clipboard
+eval            +mouse_dec       +statusline      -xterm_save
+ex_extra        +mouse_gpm       -sun_workshop    -xpm
+extra_search    -mouse_jsbterm   +syntax
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -Wdate-time  -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl     -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm
 
cs



'Operating System > Linux' 카테고리의 다른 글

ubuntu 패키지 목록 확인  (0) 2017.10.19
ubuntu git 설치  (0) 2017.10.19
ubuntu 버전 확인  (0) 2017.10.19
ubuntu group  (0) 2017.10.19
ubuntu docker 설치  (0) 2017.10.19


방법1.

1
2
3
$ cat /etc/issue
Ubuntu 16.04.3 LTS \n \l
 
cs



방법2.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
 
cs

* 위의 방법은 lsb-release 파일과 os-release 파일을 각각 불러와서 출력합니다.

1
2
3
4
$ ll /etc/ |grep release
-rw-r--r-- 1 root root     105 Jul 31 13:36 lsb-release
lrwxrwxrwx 1 root root      21 Jul 31 13:36 os-release -> ../usr/lib/os-release
 
cs



방법3.

1
2
3
$ uname -a
Linux 2a388618a88e 4.10.0-37-generic #41~16.04.1-Ubuntu SMP Fri Oct 6 22:42:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
 
cs



방법4.

1
2
3
4
5
6
7
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
 
cs


'Operating System > Linux' 카테고리의 다른 글

ubuntu git 설치  (0) 2017.10.19
ubuntu vim 설치  (0) 2017.10.19
ubuntu group  (0) 2017.10.19
ubuntu docker 설치  (0) 2017.10.19
Ubuntu Desktop 설치  (0) 2017.10.18


1. 그룹 목록 확인

1
2
3
4
5
6
7
8
9
$ cat /etc/group
root:x:0:
 
...
 
user:x:1000:
sambashare:x:128:user
ftp:x:129:
 
cs

* 그룹 목록을 출력할 경우 위와 같은 형식으로 출력됩니다.



2. 그룹 생성 및 확인

2-1. 그룹 생성

1
2
$ sudo groupadd test
 
cs

* test 라는 그룹을 그룹 목록에 추가합니다.


2-2. 그룹 생성 여부 확인

1
2
3
$ cat /etc/group |grep test
test:x:1001:
 
cs



3. 소속된 그룹 확인

1
2
3
$ groups user
user : user sambashare docker
 
cs

* 사용자가 속한 그룹 목록을 출력합니다.

* user 를 제외하고 groups 명령어만 사용할 경우 현재 접속된 유저의 소속된 그룹 목록을 출력합니다.



4. 그룹 삭제

1
2
$ sudo groupdel test
 
cs

* test 는 삭제할 그룹명입니다.



'Operating System > Linux' 카테고리의 다른 글

ubuntu vim 설치  (0) 2017.10.19
ubuntu 버전 확인  (0) 2017.10.19
ubuntu docker 설치  (0) 2017.10.19
Ubuntu Desktop 설치  (0) 2017.10.18
Ubuntu ssh server 설치  (0) 2017.10.18


Docker 를 설치하는 몇 가지 방법이 있습니다.

도커를 설치하는 몇 가지 방법이 있습니다. 여기서 살펴볼 설치 방법은 아래와 같습니다.

 ㄴ 리포지토리를 이용한 설치

 ㄴ Docker CE 를 설치

 ㄴ 스크립트를 이용한 설치


1. 리포지토리를 이용한 설치

1-1. apt 패키지 인덱스를 업데이트

1
2
3
4
5
6
7
8
9
10
11
12
$ sudo apt-get update
Hit:1 http://kr.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://kr.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://kr.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [60.3 kB]
Get:6 http://security.ubuntu.com/ubuntu xenial-security/main DEP-11 64x64 Icons [62.6 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [49.7 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe DEP-11 64x64 Icons [80.0 kB]
Fetched 355 kB in 4s (73.7 kB/s)
Reading package lists... Done
 
cs


1-2. apt 가 https 를 통해 저장소를 사용할 수 있도록 패키지들을 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$ sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
Hit:1 http://kr.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://kr.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://kr.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Fetched 102 kB in 1s (71.6 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version (1.2.24).
ca-certificates is already the newest version (20170717~16.04.1).
software-properties-common is already the newest version (0.96.20.7).
The following NEW packages will be installed:
  curl
0 upgraded, 1 newly installed, 0 to remove and 90 not upgraded.
Need to get 138 kB of archives.
After this operation, 338 kB of additional disk space will be used.
Get:1 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 curl amd64 7.47.0-1ubuntu2.3 [138 kB]
Fetched 138 kB in 0s (714 kB/s)
Selecting previously unselected package curl.
(Reading database ... 212836 files and directories currently installed.)
Preparing to unpack .../curl_7.47.0-1ubuntu2.3_amd64.deb ...
Unpacking curl (7.47.0-1ubuntu2.3) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up curl (7.47.0-1ubuntu2.3) ...
 
cs


1-3. 도커의 공식적인 GPG key 를 추가

1
2
3
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
 
cs


1-4. 지문 인식 키의 여부를 확인

1
2
3
$ sudo apt-key fingerprint 0EBFCD88 | grep docker@docker.com || exit 1
uid                  Docker Release (CE deb) <docker@docker.com>
 
cs

* "9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88" 의 마지막 8자리를 검색하여 지문 인식 키의 여부를 확인합니다.


1-5. 안정적으로 저장소를 구축하기 위한 설정

1
2
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
 
cs



2. 도커 CE 를 이용한 설치

2-1. 패키지 인덱스를 업데이트

1
2
3
4
5
6
7
8
9
10
$ sudo apt-get update
Hit:1 http://kr.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://kr.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://kr.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:4 https://download.docker.com/linux/ubuntu xenial InRelease [49.8 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:6 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages [2,579 B]
Fetched 155 kB in 2s (66.9 kB/s)
Reading package lists... Done
 
cs


2-2. 설치 가능한 도커 버전을 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ apt-cache madison docker-ce
 docker-ce | 17.10.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.09.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.09.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.07.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.06.2~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.06.2~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.06.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.06.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.06.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.06.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.05.0~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.04.0~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 docker-ce | 17.03.2~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.03.1~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.03.0~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 
cs


2-3. 가장 최근 버전의 도커 CE 를 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
$ sudo apt-get install -y docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  aufs-tools cgroupfs-mount git git-man liberror-perl
Suggested packages:
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs git-mediawiki
  git-svn
The following NEW packages will be installed:
  aufs-tools cgroupfs-mount docker-ce git git-man liberror-perl
0 upgraded, 6 newly installed, 0 to remove and 90 not upgraded.
Need to get 25.0 MB of archives.
After this operation, 126 MB of additional disk space will be used.
Get:1 http://kr.archive.ubuntu.com/ubuntu xenial/universe amd64 aufs-tools amd64 1:3.2+20130722-1.1ubuntu1 [92.9 kB]
Get:2 http://kr.archive.ubuntu.com/ubuntu xenial/universe amd64 cgroupfs-mount all 1.2 [4,970 B]
Get:3 http://kr.archive.ubuntu.com/ubuntu xenial/main amd64 liberror-perl all 0.17-1.2 [19.6 kB]
Get:4 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 git-man all 1:2.7.4-0ubuntu1.3 [736 kB]
Get:5 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce amd64 17.09.0~ce-0~ubuntu [21.0 MB]
Get:6 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 git amd64 1:2.7.4-0ubuntu1.3 [3,102 kB]
Fetched 25.0 MB in 3s (7,596 kB/s)
Selecting previously unselected package aufs-tools.
(Reading database ... 212843 files and directories currently installed.)
Preparing to unpack .../aufs-tools_1%3a3.2+20130722-1.1ubuntu1_amd64.deb ...
Unpacking aufs-tools (1:3.2+20130722-1.1ubuntu1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../cgroupfs-mount_1.2_all.deb ...
Unpacking cgroupfs-mount (1.2) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../docker-ce_17.09.0~ce-0~ubuntu_amd64.deb ...
Unpacking docker-ce (17.09.0~ce-0~ubuntu) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../liberror-perl_0.17-1.2_all.deb ...
Unpacking liberror-perl (0.17-1.2) ...
Selecting previously unselected package git-man.
Preparing to unpack .../git-man_1%3a2.7.4-0ubuntu1.3_all.deb ...
Unpacking git-man (1:2.7.4-0ubuntu1.3) ...
Selecting previously unselected package git.
Preparing to unpack .../git_1%3a2.7.4-0ubuntu1.3_amd64.deb ...
Unpacking git (1:2.7.4-0ubuntu1.3) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu19) ...
Setting up aufs-tools (1:3.2+20130722-1.1ubuntu1) ...
Setting up cgroupfs-mount (1.2) ...
Setting up docker-ce (17.09.0~ce-0~ubuntu) ...
Setting up liberror-perl (0.17-1.2) ...
Setting up git-man (1:2.7.4-0ubuntu1.3) ...
Setting up git (1:2.7.4-0ubuntu1.3) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
 
cs



3. 스크립트를 사용하여 도커를 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$ curl -fsSL https://get.docker.com/ |sudo sh
# Executing docker install script, commit: 490beaa
Warning: the "docker" command appears to already exist on this system.
 
If you already have Docker installed, this script can cause trouble, which is
why we're displaying this warning and provide the opportunity to cancel the
installation.
 
If you installed the current Docker package using this script and are using it
again to update Docker, you can safely ignore this message.
 
You may press Ctrl+C now to abort this script.
+ sleep 20
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c apt-get install -y -qq apt-transport-https ca-certificates curl software-properties-common >/dev/null
+ sudo -E sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null
+ sudo -E sh -c echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial edge" > /etc/apt/sources.list.d/docker.list
+ [ ubuntu = debian ]
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c apt-get install -y -qq docker-ce >/dev/null
+ sudo -E sh -c docker version
Client:
 Version:      17.10.0-ce
 API version:  1.33
 Go version:   go1.8.3
 Git commit:   f4ffd25
 Built:        Tue Oct 17 19:04:16 2017
 OS/Arch:      linux/amd64
 
Server:
 Version:      17.10.0-ce
 API version:  1.33 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   f4ffd25
 Built:        Tue Oct 17 19:02:56 2017
 OS/Arch:      linux/amd64
 Experimental: false
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:
 
  sudo usermod -aG docker user
 
Remember that you will have to log out and back in for this to take effect!
 
WARNING: Adding a user to the "docker" group will grant the ability to run
         containers which can be used to obtain root privileges on the
         docker host.
         Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
         for more information.
 
cs



4. 도커 설치 후 확인

4-1. 도커 버전을 출력

1
2
3
$ docker -v
Docker version 17.10.0-ce, build f4ffd25
 
cs


4-2. hello-world 를 실행

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$ sudo docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
5b0f327be733: Pull complete
Digest: sha256:07d5f7800dfe37b8c2196c7b1c524c33808ce2e0f74e7aa00e603295ca9a0972
Status: Downloaded newer image for hello-world:latest
 
Hello from Docker!
This message shows that your installation appears to be working correctly.
 
To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.
 
To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash
 
Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/
 
For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/
 
cs

* 위의 --rm 옵션은 컨테이너 안의 프로세스가 종료되면 컨테이너를 자동으로 삭제합니다.

* 도커를 실행하기 위해선 루트에 해당하는 권한이 필요하기 때문에 앞에 sudo 를 붙여 실행합니다.



5. 루트가 아닌 사용자로서 도커를 관리할 계정과 그룹을 생성

5-1. 도커 그룹을 생성

1
2
$ sudo groupadd docker
 
cs

* 도커 그룹을 추가합니다.


5-2. 도커 그룹에 속할 유저를 추가

1
2
$ sudo usermod -aG docker $USER
 
cs

* 현재 접속 중인 사용자 혹은 도커를 관리할 사용자에게 권한을 부여합니다.

* 사용자가 접속해 있는 상태라면 재접속 후에 권한이 적용됩니다.


5-3. 도커 서비스를 재시작

1
2
$ sudo service docker restart
 
cs



6. sudo 를 사용하지 않고 도커 명령어를 실행

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ docker run --rm hello-world
 
Hello from Docker!
This message shows that your installation appears to be working correctly.
 
To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.
 
To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash
 
Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/
 
For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/
 
cs


'Operating System > Linux' 카테고리의 다른 글

ubuntu 버전 확인  (0) 2017.10.19
ubuntu group  (0) 2017.10.19
Ubuntu Desktop 설치  (0) 2017.10.18
Ubuntu ssh server 설치  (0) 2017.10.18
head 명령어  (0) 2017.10.16

1.



2.



3.



4.



5.



6.



7.



8.



9.

* 설치가 끝나면 재부팅되고 완료됩니다.



'Operating System > Linux' 카테고리의 다른 글

ubuntu group  (0) 2017.10.19
ubuntu docker 설치  (0) 2017.10.19
Ubuntu ssh server 설치  (0) 2017.10.18
head 명령어  (0) 2017.10.16
ubuntu 고정 ip 할당  (0) 2017.10.13


1. ssh server 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$ sudo apt-get install openssh-server
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  ssh-askpass rssh molly-guard monkeysphere
The following NEW packages will be installed:
  openssh-server
Preconfiguring packages ...
0 upgraded, 1 newly installed, 0 to remove and 192 not upgraded.
Need to get 0 B/338 kB of archives.
After this operation, 912 kB of additional disk space will be used.
Selecting previously unselected package openssh-server.
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 177903 files and directories currently installed.)
Preparing to unpack .../openssh-server_1%3a7.2p2-4ubuntu2.2_amd64.deb ...
Unpacking openssh-server (1:7.2p2-4ubuntu2.2) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up openssh-server (1:7.2p2-4ubuntu2.2) ...
Creating SSH2 RSA key; this may take some time ...
2048 SHA256:wEyh9ic/o5fsBTE/ifbruwvOVxCbtDsVnGFxU8IRMfM root@user-virtual-machine (RSA)
Creating SSH2 DSA key; this may take some time ...
1024 SHA256:REAzAFtTDlG3sOmCukZM1TncbAHVVNeG5ZUlkPAA5YM root@user-virtual-machine (DSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:keUvMW7t3tT3j83ZK3TIYkPPn1sOiNCGzfWZu11OVL8 root@user-virtual-machine (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:dZSXWO5UQ7YGTlr6cNfM3HGrMN4bW5ljNq3eG+RPqM0 root@user-virtual-machine (ED25519)
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
 
cs



2. ssh 서비스 재시작

1
2
3
$ sudo /etc/init.d/ssh restart
[ ok ] Restarting ssh (via systemctl): ssh.service.
 
cs



3. ssh 접속 확인

3-1. 접속 정보 입력

* 접속을 위해 사용한 툴은 PuTTY 입니다. 다른 툴을 사용해도 무방합니다.



3-2. 접속 계정 정보 입력



'Operating System > Linux' 카테고리의 다른 글

ubuntu docker 설치  (0) 2017.10.19
Ubuntu Desktop 설치  (0) 2017.10.18
head 명령어  (0) 2017.10.16
ubuntu 고정 ip 할당  (0) 2017.10.13
FTP 설치 및 접속  (0) 2017.10.12

OS 환경: ubuntu 16.04


1. head

1
2
3
4
5
6
7
8
9
10
11
12
$ head 1987.csv
1987,10,14,3,741,730,912,849,PS,1451,NA,91,79,NA,23,11,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,15,4,729,730,903,849,PS,1451,NA,94,79,NA,14,-1,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,17,6,741,730,918,849,PS,1451,NA,97,79,NA,29,11,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,18,7,729,730,847,849,PS,1451,NA,78,79,NA,-2,-1,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,19,1,749,730,922,849,PS,1451,NA,93,79,NA,33,19,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,21,3,728,730,848,849,PS,1451,NA,80,79,NA,-1,-2,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,22,4,728,730,852,849,PS,1451,NA,84,79,NA,3,-2,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,23,5,731,730,902,849,PS,1451,NA,91,79,NA,13,1,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,24,6,744,730,908,849,PS,1451,NA,84,79,NA,19,14,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,25,7,729,730,851,849,PS,1451,NA,82,79,NA,2,-1,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
 
cs

* 기본적으로 10줄까지 출력되고 있습니다.


2. 지정한 라인 단위로 출력

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ head -15 1987.csv
1987,10,14,3,741,730,912,849,PS,1451,NA,91,79,NA,23,11,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,15,4,729,730,903,849,PS,1451,NA,94,79,NA,14,-1,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,17,6,741,730,918,849,PS,1451,NA,97,79,NA,29,11,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,18,7,729,730,847,849,PS,1451,NA,78,79,NA,-2,-1,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,19,1,749,730,922,849,PS,1451,NA,93,79,NA,33,19,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,21,3,728,730,848,849,PS,1451,NA,80,79,NA,-1,-2,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,22,4,728,730,852,849,PS,1451,NA,84,79,NA,3,-2,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,23,5,731,730,902,849,PS,1451,NA,91,79,NA,13,1,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,24,6,744,730,908,849,PS,1451,NA,84,79,NA,19,14,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,25,7,729,730,851,849,PS,1451,NA,82,79,NA,2,-1,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,26,1,735,730,904,849,PS,1451,NA,89,79,NA,15,5,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,28,3,741,725,919,855,PS,1451,NA,98,90,NA,24,16,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,29,4,742,725,906,855,PS,1451,NA,84,90,NA,11,17,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,31,6,726,725,848,855,PS,1451,NA,82,90,NA,-7,1,SAN,SFO,447,NA,NA,0,NA,0,NA,NA,NA,NA,NA
1987,10,1,4,936,915,1035,1001,PS,1451,NA,59,46,NA,34,21,SFO,RNO,192,NA,NA,0,NA,0,NA,NA,NA,NA,NA
 
cs

* 지정를 15로 지정했기 때문에 15라인 만큼 출력되고 있습니다.

* "head -15 파일명" 혹은 "head -n 15 파일명" 둘 다 동일하게 출력됩니다.



3. 지정한 바이트 단위로 출력

1
2
3
$ head -c 10 1987.csv
1987,10,14
 
cs

* 지정한 10바이트 만큼 출력되고 있습니다. 숫자 및 특수문자 각 1바이트입니다.



'Operating System > Linux' 카테고리의 다른 글

Ubuntu Desktop 설치  (0) 2017.10.18
Ubuntu ssh server 설치  (0) 2017.10.18
ubuntu 고정 ip 할당  (0) 2017.10.13
FTP 설치 및 접속  (0) 2017.10.12
root 비밀번호 설정  (0) 2017.10.12


1. ip 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ ifconfig
ens160    Link encap:Ethernet  HWaddr 12:0c:29:3a:id:ab
          inet addr:192.168.10.30  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:593671 errors:0 dropped:0 overruns:0 frame:0
          TX packets:297404 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:460588158 (460.5 MB)  TX bytes:112335278 (112.3 MB)
 
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:91186 errors:0 dropped:0 overruns:0 frame:0
          TX packets:91186 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:12822719 (12.8 MB)  TX bytes:12822719 (12.8 MB)
 
cs

* 위에 표기된 내용은 임의의 값입니다.



2. interfaces 파일 편집

1
2
$ sudo vi /etc/network/interfaces
 
cs


2-1. interfaces 수정 전

1
2
3
4
5
6
7
8
9
10
11
12
13
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
 
source /etc/network/interfaces.d/*
 
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto ens160
iface ens160 inet dhcp
 
cs


2-2 interfaces 수정 후

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
 
source /etc/network/interfaces.d/*
 
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto ens160
iface ens160 inet static
        address 192.168.10.30
        netmask 255.255.255.0
        broadcast 192.168.10.255
        gateway 192.168.10.1
        network 192.168.10.0
        dns-nameservers 8.8.8.8
 
cs

* 위와 같이 수정 후 저장합니다.



3. networking.service 재시작

1
2
$ sudo systemctl restart networking.service
 
cs



4. 시스템 재부팅

1
2
$ sudo reboot now
 
cs



'Operating System > Linux' 카테고리의 다른 글

Ubuntu ssh server 설치  (0) 2017.10.18
head 명령어  (0) 2017.10.16
FTP 설치 및 접속  (0) 2017.10.12
root 비밀번호 설정  (0) 2017.10.12
Ubuntu Server 설치  (0) 2017.10.12


1. vsftp 다운로드

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$ sudo apt-get install vsftpd
sudo: unable to resolve host ubuntu
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  ssl-cert
Suggested packages:
  openssl-blacklist
The following NEW packages will be installed:
  ssl-cert vsftpd
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 132 kB of archives.
After this operation, 398 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 ssl-cert all 1.0.37 [16.9 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 vsftpd amd64 3.0.3-3ubuntu2 [115 kB]
Fetched 132 kB in 6s (21.0 kB/s)
Preconfiguring packages ...
Selecting previously unselected package ssl-cert.
(Reading database ... 60283 files and directories currently installed.)
Preparing to unpack .../ssl-cert_1.0.37_all.deb ...
Unpacking ssl-cert (1.0.37) ...
Selecting previously unselected package vsftpd.
Preparing to unpack .../vsftpd_3.0.3-3ubuntu2_amd64.deb ...
Unpacking vsftpd (3.0.3-3ubuntu2) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up ssl-cert (1.0.37) ...
hostname: Name or service not known
make-ssl-cert: Could not get FQDN, using "ubuntu".
make-ssl-cert: You may want to fix your /etc/hosts and/or DNS setup and run
make-ssl-cert: make-ssl-cert generate-default-snakeoil --force-overwrite
make-ssl-cert: again.
Setting up vsftpd (3.0.3-3ubuntu2) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
 
cs

* 설치 중에 계속 진행할지 여부를 묻는데 Y 를 눌러 계속 진행합니다.



2. vsftpd.conf 파일 편집

1
2
$ sudo vi /etc/vsftpd.conf
 
cs



3. vsftpd.conf 파일 수정

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Example config file /etc/vsftpd.conf
 
...
 
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
 
# Uncomment this to enable any form of FTP write command.
write_enable=YES
 
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log
 
 
cs

* 위와 같이 주석 처리된 부분을 해제하고 저장합니다.

* 필요에 따라 각 옵션을 주석 처리하거나 해제하면 됩니다.

* anonymous_enable : 익명 사용자의 접속

* write_enable : 쓰기 가능 여부

* xferlog_file : default 로 설정된 vsftpd 에 대한 로그 정보



4. vsftpd.conf 파일 수정 후 ftp 서버 재기동

1
2
3
4
$ sudo /etc/init.d/vsftpd restart
sudo: unable to resolve host ubuntu
[ ok ] Restarting vsftpd (via systemctl): vsftpd.service.
 
cs



5. ftp 프로그램을 통한 접속 여부 확인

* 위의 ftp client 는 filezilla 입니다.

* 다른 ftp 프로그램을 이용해도 확인 유무에 이상 없습니다.



'Operating System > Linux' 카테고리의 다른 글

head 명령어  (0) 2017.10.16
ubuntu 고정 ip 할당  (0) 2017.10.13
root 비밀번호 설정  (0) 2017.10.12
Ubuntu Server 설치  (0) 2017.10.12
SSH 생성 및 분배  (0) 2017.10.10


Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0.-87-generic x86_64)


1
2
3
4
5
$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
 
cs

* "Enter new UNIX password" 부분에 새롭게 설정할 비밀번호를 입력합니다.

* "Retype new UNIX password" 부분에 새롭게 설정한 비밀번호를 한 번 더 입력합니다.



'Operating System > Linux' 카테고리의 다른 글

ubuntu 고정 ip 할당  (0) 2017.10.13
FTP 설치 및 접속  (0) 2017.10.12
Ubuntu Server 설치  (0) 2017.10.12
SSH 생성 및 분배  (0) 2017.10.10
disk mount  (0) 2017.10.10

+ Recent posts