0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ubuntuのGPUサーバーセットアップ[備忘録]

0
Last updated at Posted at 2017-11-21

Ubuntuのインストール

ubuntu ver16.04

  1. Install Ubuntu Server
  2. Select a language -> English
  3. Select your location -> Other,Asia,Japan
  4. Configure locales -> United States
  5. Configure key board -> Japanese
  6. Configure Network -> esnp02
  7. hostname -> ubuntu05
  8. Set up users and passwords -> enter full name
  9. Set up users and passwords -> enter username
  10. Set up users and passwords -> enter password
  11. Encrypt your home directory? -> No
  12. Configure clock -> Asia/Tokyo
  13. Partition disks -> Use entire disks
  14. Configure the package manager -> pass proxy
  15. Configuring tasksel -> No automatic updates
  16. Software selection -> DNS server, standard system utilities, OpenSSH server

ネットワークの設定

sshが入っていることを確認

root@ubuntu:~$ which ssh
/usr/bin/ssh

静的IP設定

IPを確認
root@ubuntu:~$ ifconfig
enp2s0    Link encap:Ethernet  HWaddr 70:85:c2:4a:5f:1b  
          inet addr:192.168.1.6  Bcast:192.168.1.255  Mask:255.255.255.0 #ここをメモ
          inet6 addr: fe80::7285:c2ff:fe4a:5f1b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1707 errors:0 dropped:88 overruns:0 frame:0
          TX packets:460 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:255363 (255.3 KB)  TX bytes:66860 (66.8 KB)
          Memory:92d00000-92d1ffff 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:175 errors:0 dropped:0 overruns:0 frame:0
          TX packets:175 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:12937 (12.9 KB)  TX bytes:12937 (12.9 KB)
gatewayの確認
root@ubuntu:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.21    0.0.0.0         UG    0      0        0 enp2s0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp2s0
nameserverの確認
root@ubuntu:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.21
hostsの編集
  • hostsを開く
sudo vi /etc/network/interfaces
  • 該当箇所を以下のように編集
# The primary network interface
auto enp2s0
iface enp2s0 inet static
        address 192.168.1.6
        netmask 255.255.255.0
        gateway 192.168.1.21
        dns-nameservers 192.168.1.21

hostname確認

# 現在のホスト名を表示
root@ubuntu:~$ hostname 
ubuntu
  • 変更するとき

  • ホスト名 を gpu04 のように指定。

    • root@ubuntu:~$ hostname -b gpu04
    • /etc/hosts に 127.0.0.1 gpu04 のように追加
  • DNSサーバ設定

    • /etc/resolve.conf に以下指定
      • nameserver 192.168.1.21

最新化

apt-get dist-upgrade

hostnameで入れるようにする

localで

localhost:~$ sudo vi /etc/hosts

以下を追加
IPaddress hostname

初期ユーザー登録

adduser s-wada
adduser y-koba

sudo権限つける。もともと sudo という(wheelのような)ユーザーがいる。

usermod -aG sudo s-wada
usermod -aG sudo y-koba

参考

https://qiita.com/shishamo_dev/items/3602c41f143c08fadb1a
https://webkaru.net/linux/ubuntu-14-04-lts-install/
https://jyn.jp/ubuntu-localip-static/
https://www.server-world.info/query?os=Ubuntu_16.04&p=hostname

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?