1
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 3 years have passed since last update.

Clear Linux 試してみた SMB編

Posted at

まず何やるか?

sshは出来たので、リモートの別荘からアクセスするようにはしたのだが、リモートから逆に自宅のサーバにアクセスするとGUIが欲しくなって、RDPを入れようとしてもちょっとドキュメントが見つからず、こちらはハードルが高そう。
と言うことで、今回はhostnameの変更とSambaをとりあえず入れてみた。

$ sudo swupd update
$ sudo swupd update
Password: 
Update started
Version on server (35790) is not newer than system version (35790)
Update complete - System already up-to-date at version 35790

システムが付けるHostnameはアホほど長いので当然誰でもすぐ変えたくなる。

clr-3b3396ac4b5a42f4ba461415b69db1d6~ $ sudo hostnamectl set-hostname hogehoge
Password: 

hogehoge $ sudo reboot

これで完了

samba

$ sudo swupd bundle-add samba
$ sudo mkdir /etc/samba
$ sudo vi /etc/samba/smb.conf

なんと、Ubuntuの様にはDirやConfファイルを作ってくれたりはしない!自分で作るんですね。

[Global]
map to guest = Bad User

[SharedDrive]
path=/home/clear/myshareddrive
read only = no
guest ok = no
browsable = yes
valid users = user-1 user-2

$ sudo mkdir /home/clear/myshareddrive
$ sudo chmod 755 /home/clear/myshareddrive
$ sudo chown user-1.user-1 /home/clear/myshareddrive
この辺りは自分で適当に考えてね。

さて、いよいよスタート

$ sudo systemctl enable --now smb
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor prese>
     Active: active (running) since Wed 2022-02-02 23:37:26 JST; 18s ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)

つながるかの確認は

$ smbclient //127.0.0.1/ShareDrive
Password for [WORKGROUP\hogehoge]:
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

なにー! となってトラブルシュートしました。結果は・・・

ShareNameとDriveNameが間違っていた。
日本人にとって、こんな名前を例に付けるヤツが憎いわ!
正解 SharedDrive 
間違い ShareDrive
(path名も同じだから)

これに気づくのに小一時間・・・

$ smbclient //127.0.0.1/share
Password for [WORKGROUP\hogehoge]:
Try "help" to get a list of possible commands.
smb: \>

お疲れでした。

参照リンク
https://docs.01.org/clearlinux/latest/guides/maintenance/hostname.html
https://docs.01.org/clearlinux/latest/tutorials/smb-server.html#smb-server

1
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
1
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?