Nfs

共 3 篇文章

單人用的NFS idmapping

1 分鐘閱讀

Introduction

NFS雖然是很方便的掛載方法,但不像samba或sshfs一樣可以做身份認證
本機的UID是什麼寫入到NFS server的UID就是什麼

e.g. 本機的UID是1001, username是hunglin
但NFS server的hunglin的UID是1000
但寫入到遠端的檔案會顯示1001而不是hunglin

本機
{% code %} drwxr-sr-x 7 hunglin hunglin 10M Mar 1 2022 file.txt {% endcode %}

NFS server {% code %} drwxr-sr-x 7 1001 1001 10M Mar 1 2022 file.txt {% endcode %}

如果NFS server和本機都只有自己使用的話有個方法可以間接的mapping id

指定匿名ID

NFS server端可以在/etc/export設定anonymous的uid和gid

all_squash,anonuid=1001,anongid=1001

https://linux.die.net/man/5/exports

all_squash是指將寫入的檔案的user和group都壓縮成anonymous的uid和gid
只要將anonuid和anongid設定成server端user的uid和gid就可以做到idmapping

重啟nfs server {% code lang:sh %} sudo /etc/init.d/nfs-kernel-server restart sudo start idmapd {% endcode %}

Ubuntu 22.04 setup after installation

2 分鐘閱讀

The following setup is my customization while ubuntu initialization

Operating System

Input method

fcitx5-rime

sudo apt install fctix5-*
im-config  

勉強適合Ubuntu22.04的中文輸入法

nfs-common

sudo apt install nfs-common
sudo mount -t nfs $remote_host:/remote/path /local/path

GNOME

window minimize

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

circle windows

gsettings set org.gnome.shell.extensions.dash-to-dock scroll-action 'cycle-windows'

If the commands are not working, you can install dconf-editor to set.

Switching between windows with scroll wheel on Ubuntu Dock
Essential Guide: How to Enable ‘Minimize on Click’ on Ubuntu Quickly