2020年6月4日 星期四

2020年6月1日 星期一

[Linux指令] grep 排除多個資料夾


Ex: 搜尋n/a , 並且排除logs logs_1兩個資料夾下的檔案

grep -rn "n/a" . --exclude-dir={logs,logs_1}

2020年5月26日 星期二

[Linux CentOS 7] samba 安裝以及win10登入samba一直出現密碼錯誤問題

$ dnf install samba samba-client samba-common -y
安裝好之後查看這是samba 4.10.4版

修改smb.conf
$ cd /etc/samba
$ cp smb.conf smb.conf.org
$ vi smb.conf

[global]
        workgroup = tiogapass
        security = user
        ntlm auth = true
        passdb backend = tdbsam

[homes]
        comment = Home Directories
        valid users = %S
        browseable = no
        read only = no
其中 ntlm auth = true 這行可以讓win10登入samba的時候不會出現帳號密碼錯誤的訊息

重啟smba service
# systemctl restart smb.service
# systemctl restart nmb.service

設定防火牆

firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --zone=public --add-service=samba
完成

2020年5月24日 星期日

2020年5月21日 星期四

[Linux CentOS 7] 最小化安裝 開機不會自動取得IP

CentOS 7 最小化安裝下需要自己手動取得dhcp IP

ex:  dhclient eno1

要是想要開機都能自動取得IP

cd /etc/sysconfig/network-scripts
依照自己的網路介面名稱開啟檔案,例如我這邊是eno1
vi vi ifcfg-eno1
將ONBOOT這個改成yes

ONBOOT=yes

2020年5月18日 星期一

[ubuntu 14.04] 使用者sudo權限設定

ex: 帳號terry

先建立帳號
$ sudo adduser terry

然後把terry加入sudo群組
$ usermod -aG sudo terry

使用groups查看是否在sudo列裡面
$ groups terry
terry : terry sudo

2020年5月14日 星期四

[Ubuntu 14.04] 遠端桌面使用原生ubuntu14.04桌面

方法1:  1. 要先在原始VGA下打開terminal console 2. 輸入     $  gsettings set org.gnome.Vino require-encryption false                                     ...