새로운 Linux kernel version이 설치되었다고 해서, 새로 설치한 Kernel version으로 부팅되는 것이 아니다.
GRUB 설정을 수정해야 내가 원하는 linux kernel version으로 부팅된다.
아래 예제 GRUB 파일과 같이 수정하면 된다.
$ vi /etc/default/grub
... 중간 생략 ...
## 방금 새로 설치한 linux kernel version에 대한 이름을 설정한다.
GRUB_DEFAULT='Advanced options for Ubuntu>Ubuntu, with Linux 4.15.0-137-generic'
## 아래와 같이 설정하면, 3초 동안 countdown하는 화면이 나온다.
## countdown하는 동안에 'ESC or F4 or SHIFT' 키를 누르면 GRUB 부팅 설정이 나온다.
## 이때 Default kernel version이 아닌 다른 kernel version을 고를 수 있다.
GRUB_TIMEOUT_STYLE=countdown
GRUB_TIMEOUT=3
... 중간 생략 ...
grub 설정 파일을 저장하고, 아래와 같이 update-grub 명령을 수행한다.
$ update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-213-generic
Found initrd image: /boot/initrd.img-4.15.0-213-generic
Found linux image: /boot/vmlinuz-4.15.0-143-generic
Found initrd image: /boot/initrd.img-4.15.0-143-generic
Found linux image: /boot/vmlinuz-4.15.0-142-generic
Found initrd image: /boot/initrd.img-4.15.0-142-generic
Found linux image: /boot/vmlinuz-4.15.0-137-generic
Found initrd image: /boot/initrd.img-4.15.0-137-generic
done
$
Linux OS를 reboot
아래와 같이 reboot 명령을 수행하고, 부팅 초기에 "countdown" 화면이 나오면
[ESC] 또는 [SHIFT] 또는 [F4] 키를 눌러서 원하는 Linux kernel version을 선택한다.
$ reboot
GNU GRUB 화면 (Linux kernel version 선택)
GNU GRUB 화면 (Linux kernel version 선택)
Linux kernel version의 적용 여부 확인
아래와 같이 `uname -sr` 명령으로 새로 설치한 linux kernel version으로 부팅되었는지 확인한다.
Ubuntu 24.04 또는 Ubuntu 22.04에 Samba(SMB) 서버를 설치하고 싶다면 아래 절차를 따라하면 잘 동작한다.
##
## Samba 서버 프로그램을 설치한다.
##
$ sudo apt-get update
$ sudo apt-get install -y samba
...
##
## Samba 서버가 공유할 폴더(디렉토리) 정보를 설정한다.
##
$ vi /etc/samba/smb.conf
... 중간 생략 ...
;
; 아래 내용을 추가한다.
;
[mybox]
comment = My File Box
path = /home/sejong
guest ok = no
browseable = yes
writable = yes
create mask = 0777
directory mask = 0777
valid users = sejong
... 중간 생략 ...
##
## Linux 계정 'sejong'을 samba 접근 계정으로 추가한다.
## 암호는 Linux 계정 'sejong'의 암호와 달라도 된다.
##
$ sudo smbpasswd -a sejong
##
## Samba 서버 데몬을 재기동한다.
##
$ sudo /etc/init.d/smbd restart
## 또는 위 명령을 아래와 같이 수행해도 된다.
## $ sudo systemctl restart smbd
클라이언트 PC에서 아래와 같이 Samba 서버에 접속시도한다. (아래는 Macbook에서 실행한 화면)
Macbook에서 Samba 서버에 접속 시도
Samba 서버 설정 끝 !!! Samba 서버 관리 명령을 알고 싶다면, 아래 내용을 더 읽어보아요~~
Samba 계정 정보를 보고 싶다면, 아래와 같이 `pdbedit` 명령으로 조회할 수 있다.
$ pdbedit -L -v
---------------
Unix username: sejong
NT username:
Account Flags: [U ]
Home Directory: \\ANDREW-UBUNTU\sejong
HomeDir Drive:
Logon Script:
Profile Path: \\ANDREW-UBUNTU\sejong\profile
Domain: ANDREW-UBUNTU
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: Thu, 07 Feb 2036 00:06:39 KST
Kickoff time: Thu, 07 Feb 2036 00:06:39 KST
Password last set: Wed, 07 Dec 2022 16:06:30 KST
Password can change: Wed, 07 Dec 2022 16:06:30 KST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
$
Samba 서버에 접속한 Client 정보를 보고 싶다면 아래와 같이 `smbstatus` 명령을 사용한다.
$ smbstatus
Samba version 4.15.9-Ubuntu
PID Username Group Machine Protocol Version Encryption Signing
----------------------------------------------------------------------------------------------------------------------------------------
295419 sejong sejong 10.1.3.169 (ipv4:10.1.3.169:63352) SMB3_11 - partial(AES-128-CMAC)
Service pid Machine Connected at Encryption Signing
---------------------------------------------------------------------------------------------
mybox 295419 10.1.3.169 Wed Dec 7 04:23:23 PM 2022 KST - -
Locked files:
Pid User(ID) DenyMode Access R/W Oplock SharePath Name Time
--------------------------------------------------------------------------------------------------
295419 1001 DENY_NONE 0x100081 RDONLY NONE /home/sejong . Wed Dec 7 16:23:22 2022
계정 정보를 변경하고 싶다면, `usermod` 명령을 사용한다.
$ usermod --help
Usage: usermod [options] LOGIN
Options:
-b, --badnames allow bad names
-c, --comment COMMENT new value of the GECOS field
-d, --home HOME_DIR new home directory for the user account
-e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-f, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-g, --gid GROUP force use GROUP as new primary group
-G, --groups GROUPS new list of supplementary GROUPS
-a, --append append the user to the supplemental GROUPS
mentioned by the -G option without removing
the user from other groups
-h, --help display this help message and exit
-l, --login NEW_LOGIN new value of the login name
-L, --lock lock the user account
-m, --move-home move contents of the home directory to the
new location (use only with -d)
-o, --non-unique allow using duplicate (non-unique) UID
-p, --password PASSWORD use encrypted password for the new password
-R, --root CHROOT_DIR directory to chroot into
-P, --prefix PREFIX_DIR prefix directory where are located the /etc/* files
-s, --shell SHELL new login shell for the user account
-u, --uid UID new UID for the user account
-U, --unlock unlock the user account
-v, --add-subuids FIRST-LAST add range of subordinate uids
-V, --del-subuids FIRST-LAST remove range of subordinate uids
-w, --add-subgids FIRST-LAST add range of subordinate gids
-W, --del-subgids FIRST-LAST remove range of subordinate gids
-Z, --selinux-user SEUSER new SELinux user mapping for the user account