Posts

Showing posts with the label Server

Display Samba Server in windows network: Install wsdd on Ubuntu 22.04

 Display Samba Server in windows network: Install wsdd on Ubuntu 22.04   Reference: https://installati.one/install-wsdd-ubuntu-22-04/?expand_article=1 https://pcvogel.sarakura.net/2022/03/22/34526

Samba Security Mask

Set correct parameter for Mask and Directory when wite from other PC, see below, [anaheim]     path = /mnt/anaheim     force user = nobody     force group = nogroup     public = yes     writeable = yes     unix extensions = no     ;share modes = yes     create mode = 0777     force create mode = 0777     security mask = 0777     force security mode = 0777     directory mode = 0777     force directory mode = 0777     directory security mask = 0777     force directory security mode = 0777 Reference  https://serverfault.com/questions/645081/samba-permissions-being-ignored   https://askubuntu.com/questions/97669/i-cant-get-samba-to-set-proper-permissions-on-created-directories  with Mac OS  "unix extensions = no" https://work-work.work/blog/2018/12/1...

Set column as unique in SQL Server from the Management Studio

 Set column as unique in SQL Server from the Management Studio 1. Open SQL Server Management Studio. 2. Right click your Table, click "Design". 3. Right click the column you want to edit, a popup menu appears, choose "Indexes/Keys". 4. Click the "Add" Button. 5. Expand the "General" tab. 6. Choose the Columns to make unique selected in the "columns" box. 7. Change "Is Unique" to "Yes". 8. Click "Close". 9. Save the Database.   Reference:  https://stackoverflow.com/questions/5181877/how-can-i-create-a-unique-constraint-on-my-column-sql-server-2008-r2

Samba Active Directory

      Reference: https://www.google.com/search?channel=fs&client=ubuntu&q=+%E3%82%B5%E3%83%B3%E3%83%90+%E3%82%A2%E3%82%AF%E3%83%86%E3%82%A3%E3%83%96%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA+%E5%B0%8E%E5%85%A5 SambaをActive Directoryドメインコントローラとして設定する OSAKANA TAROのメモ帳 amba4.12でActive Directory構築の手順(まとめ) Ubuntu 18.04 に Samba 4.7 を導入 sambaでActive Directoryドメインコントローラー                        

Ubuntu Server Install Procedure

 1. Create USB boot image     a. Download iso image     b. Run Start up disk creator from application menu     c. Boot and Install Ubuntu Server 2. GUI install $ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get install tasksel $ sudo tasksel 3. Set Static IP address     a. Install network-manager         $ sudo apt-get install network-manager     b. Edit configuration file              $ sudo nautilus          edit " 00-installer-config.yaml "                 network:                  version: 2                    renderer:  NetworkManager                 Note: Just above text only no ; or rem...

ubuntu mount command

ubuntu mount command /etc/fstab -編集可能 /etc/mtab -編集不可 Reference: https://eng-entrance.com/linux-mount https://www.it-mure.jp.net/ja/linux/fstab%E3%81%A8mtab%E3%82%92%E7%B7%A8%E9%9B%86%E3%81%97%E3%81%9F%E5%BE%8C%E3%80%81%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%E3%82%92%E5%86%8D%E8%B5%B7%E5%8B%95%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B%EF%BC%9F/960205303/

Difference force create mode and create mask

Difference force create mode and create mask "create mask" と"directory mask" は共有フォルダ上に作成できるアクセス許可の上限値を指定しています。共有フォルダ内に誰でも読めるファイルを格納したくない場合は、"create mask = 0760" としておくことで、ファイルのオーナーであっても、グループ以外のメンバーが読み込めるファイルを作成することはできません。"directory mask" も同様です。  しかし、ユーザーの操作により、"create mask"より低いアクセス権の設定は可能です。これを防ぎたい場合は、似たパラメーターである "force create mode" を使います。"force create mode" で指定されたアクセス許可以外のファイルは作成できず、アクセス許可の種類を変更することはできません。 "force create mode = 660" とした場合は、グループのユーザーが書き込みできないファイルは作成できなくなります。 Reference: https://thinkit.co.jp/article/766/1?nopaging=1

Samba Recycle Bin

Recycle Bin Function ごみ箱機能 Samba日本語版には、ごみ箱機能と呼ばれる機能が用意されています。この機能を使用すると、ユーザーが削除したファイルを所定のフォルダに保存しておくことができます。このため、ユーザが誤って削除したファイルを復活させることが可能です。 ごみ箱機能を使用するためには、共有サービスに"recycle bin"パラメータを追加します。 [DEVELOP] path = /var/samba/development writeable = Yes recycle bin = .recycle この設定により、ユーザが共有サービス上のファイルを削除したときに、 /var/samba/development/.recycleディレクトリにファイルが移動します。 ただし、.recycleディレクトリ内のファイルは削除されずに 残ったままとなりますので、定期的にcronなどで古くなった ファイルの削除などを実施するほうが良いでしょう。 次の設定を行うと、ユーザのホームディレクトリごみ箱用としてrecycleフォルダが作成されます。 [homes]     comment = %S's Home Directories writeable = Yes     browseable = No     recycle bin = recycle Reference: https://users.miraclelinux.com/technet/document/samba/samba0013.html

netplan networkd network-manager

netplan networkd network-manager https://ubuntu.com/server/docs/network-introduction https://ubuntu.com/server/docs/network-configuration https://netplan.io/reference https://www.linux.com/topic/distributions/how-use-netplan-network-configuration-tool-linux/ https://vitux.com/how-to-configure-networking-with-netplan-on-ubuntu/ Install networkmanager with sudo apt-get install network-manager https://askubuntu.com/questions/1031439/am-i-running-networkmanager-or-networkd     # Let NetworkManager manage all devices on this system network:   version: 2   renderer: NetworkManager Static IP Address Assignment To configure your system to use static address assignment, create a netplan configuration in the file /etc/netplan/99_config.yaml. The example below assumes you are configuring your first Ethernet interface identified as eth0. Change the addresses, gateway4, and nameservers values to meet the requirements of your network. network:   versio...

Ubuntu Samba Server Configuration

Ubuntu Samba Server Configuration smb.conf [global] ## Browsing/Identification ### workgroup = WORKGROUP → ワークグループ名の設定 dos charset = CP932 → Windowsマシンとの通信時に使用する文字コードの指定 unix charset = utf-8 → Unixマシンとの通信時に使用する文字コードの指定 unix extensions = no → Macから接続する場合には必要 hosts allow = 192.168.1.0/255.255.255.0 → sambaサーバへのアクセスを許可するIPアドレスの指定 ### Debugging/Accounting ### log level = 1   → 出力するログのレベルを指定。数値は0〜10まで指定可能。数値が大きいほど詳細なログを出力 log file = /var/log/samba/log.%m → ログの保存場所の指定。%mはアクセスしてきたユーザマシン名に 置き換わる変数。つまりこの場合はユーザマシン毎にログを出力する max log size = 1000 → ログファイルの最大サイズの指定。単位はキロバイト。 左の場合は最大1MB。1MBを越えると、ログファイル末尾に 「.old」が付けられて新しいログファイルが作成される。 すでに「.old」が存在していた場合は削除されて上書きされる ###### Authentication ###### map to guest = never   → ゲスト認証の無効化。有効にする場合は「never」ではなく 「bad user」を記述 #============= Share Definitions =============# [homes] comment = Home Directories → ディレクトリの説明に記述されるコメント browseable = no → ディレクトリを共有一覧に表示しないための設定。 例えばwindowsの場合は「ネットワーク」上に表示されない。 表示する場合は「yes...

Ubuntu Samba Server Setup Procedure - Group and Permission

Ubuntu Samba Server Setup Procedure 1. Install Samba Server $ sudo apt-get install samba 2. Uninstall Samba Server $ sudo apt-get autoremove --purge samba $ sudo apt-get remove samba $ sudo apt-get autoremove samba 3. Create User      a. Setup User in Ubuntu   $ useradd -m <user>      b. Setup User in Samba Server $ pdbedit -a <user>      c. Password Change $ sudo passwd <user> 4. Create Group in Ubuntu sambaでは、sambaが動作するLinux上に存在するグループ毎に、共有するファイルやディレクトリのアクセス権を変更できます。      a.  Create Group $ groupadd <group>      b. Add User to Group $ gpasswd -a <user1> <group> $ gpasswd -a <user2> <group> User および Group 一覧は、 /etc/フォルダーの group ファイルに記載されています。 5. Change ownership and Setup Permission      a. Change Ownership $ sudo chown -R nobody:nogroup /mnt/sales   $ c...

Windows 10 how to show all network computers

Windows 10 how to show all network computers 手順1. Windows10のアップデートによって無効化されたSMB 1.0/CIFS共有のサポートを有効化する方法 1. Control Panel - Programs - Programs and Features - Turn Windows features on or off プログラムメニューの「プログラムと機能」の中にある「Windowsの機能の有効化または無効化」をクリックしましょう。 2. "SMB 1.0/CIFS File Sharing Support" をクリックしてチェックボックスをオンにしたら「OK」をクリックしてパソコンを再起動しましょう。 手順2, 以下のサービスを起動させる。(サービスはコントロールパネルの管理ツールの中) スタートアップの種類を[自動((遅延開始)]に設定します。 [適用]をクリックします。 Function Discovery Provider Host Function Discovery Resource Publication Network Connections UPnP Device Host Peer Name Resolution Protocol Peer Networking Grouping Peer Networking Identity Manager Reference: https://aprico-media.com/posts/2456 https://www.blockmodule.com/archives/2874 https://applica.info/windows10-network-can-not-display http://arctica.sakura.ne.jp/cent/archives/5502

Install Gnome to Ubuntu Server 20.04 and 18.04

Install Gnome to Ubuntu Server 20.04 and 18.04 updating the repositories and package lists     sudo apt-get update && sudo apt-get upgrade Install the tasksel manager utility     sudo apt-get install tasksel Run program,     sudo tasksel

Webmin Install on Ubuntu Server 18.04

Webmin Install on Ubuntu Server 18.04   1. Add new repository     $ sudo nautiluse          Edit /etc/apt/sources.list           Add below line to the bottom of the file           deb http://download.webmin.com/download/repository sarge contrib           Save file and exit editor. 2. Add the Webmin PGP key. To let system      wget http://www.webmin.com/jcameron-key.asc      $ sudo apt-key add jcameron-key.asc 3. Update list of packages to include Webmin repository      $ sudo apt-get update 4. Install Webmin. $ sudo apt install webmin $ sudo reboot   5. Run Webmin           https://<ip_address>:10000 Output Webmin install complete. You can now login to https://your_server_ip:10000 as root with your root password, or as any user who can use `sudo`. R...

Ubuntu 20.04 with remote-desktop xrdp

xrdp remote-desktop setup 1. Install xrdp to Ubuntu 20.04 sudo apt install xrdp 2. Auto start setup after reboot sudo systemctl enable xrdp 3. Check Status sudo systemctl status xrdp 4. Firewall Setup Install gufw -GUI firewall 5. Add shell script to show side menu on Ubuntu desktop Add below text file and save as " enhanced-session-mode. sh " in home folder. --------------- script start ------------------ #!/bin/sh # Add script to setup the ubuntu session properly if [ ! -e /etc/xrdp/startubuntu.sh ]; then cat >> /etc/xrdp/startubuntu.sh << EOF #!/bin/sh export GNOME_SHELL_SESSION_MODE=ubuntu export XDG_CURRENT_DESKTOP=ubuntu:GNOME exec /etc/xrdp/startwm.sh EOF chmod a+x /etc/xrdp/startubuntu.sh fi sed -i_orig -e 's/startwm/startubuntu/g' /etc/xrdp/sesman.ini # rename the redirected drives to 'shared-drives' sed -i -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini # Changed the allowed_users se...

Mount Drive in Ubuntu

Mount Drive in Ubuntu Open "Disks" Edit Mount Options Automatic Mount Options - OFF      - or - Open "GParted"      - then - 1. Go to folder 2. Open as administrator 3. Change Permissions Mount Location: /media               Mount point for removable media /mnt                  Mount point for mounting a filesystem temporarily

Samba Server User and Group Setup and Permission

sambaサーバによるファイル共有環境の構築手順 https://www.virment.com/config-sambaserver/ Samba user must have an account on Ubuntu. Create a user in Ubuntu then make the following, 1. Add Samba User sudo pdbedit -a user-name 2. Change Password sudo smbpasswd user-name          -for existing user sudo smbpasswd user-name          -for new user 3. Add Group sudo groupadd group-name 4. Add User to Group sudo gpasswd -a user-name group-name 5. Edit Samba setting file, etc/samba/smb.conf 6. Ubuntsu file permission setting

MySQL

http://umatomakun.hatenablog.com/entry/2014/04/25/223240 Install in Terminal Version Check    $ sudo apt-get update    $ apt-cache show mysql-server | grep Version Install    $ sudo apt-get install mysql-server    $ mysql --version Configuration    $ cd /etc/mysql    $ cp my.cnf my.cnf.org Character Code Setup    $ sudo vi my.cnf Add Below Section [client] default-character-set = utf8 [mysqld] skip-character-set-client-handshake character-set-server  = utf8 collation-server      = utf8_general_ci init-connect          = SET NAMES utf8 Restart MySQL    $ sudo service mysql restart Login to MySQL    $ mysql -u root -p Check Status of MySQL    mysql> status Start, Stop and Re-start,    $ sudo service mysql start    $ sudo service mysql stop    $ sudo service mysql r...

File Permission, add user and group for Ubuntsu Samba Server

1. Permission 設定 $ sudo chown -R nobody:nogroup /mnt/sales  ← 共有ディレクトリ所有者変更例 $ sudo chmod -R 777 /mnt/sales  ← 共有ディレクトリPermission 設定例 $ sudo ls /mnt/sales  ← Permission 確認コマンド 2.ユーザー設定      a. グループを追加 $ sudo groupadd doriftars      b. ユーザー・パスワードの追加             以下はコマンドですが、GUIで設定する方が簡単 $ sudo useradd -s /sbin/nologin user.name $ sudo passwd user.name      c. Sambaに先ほど追加したユーザー・パスワードのを追加  ← これ大事 忘れるとアクセスできない $ pdbedit -a user.name      d. グループにユーザーを追加 $ gpasswd -a  user.name group.name User setup Note ----------------------------------- ユーザーをグループに追加したり削除するには3種類のコマンドが有ります。       gpasswd -通常こちらを使う -GNU/Linux only command       usermod -全てのユーザーを記載する必要がある  -can use for macOS X or BSD      vigr       gpasswd -a  user.name group.name  -add user       gpasswd -d user.name ...