nas:readynas_duo_v2_openwrt_useradd
差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
nas:readynas_duo_v2_openwrt_useradd [2022/05/28 19:05] – 作成 nipa28 | nas:readynas_duo_v2_openwrt_useradd [2022/05/28 21:46] (現在) – [一般ユーザーでSSHアクセスする] nipa28 | ||
---|---|---|---|
行 20: | 行 20: | ||
手順 | 手順 | ||
---- | ---- | ||
+ | |||
+ | ユーザー管理に役立ちそうなパッケージを追加する。 | ||
``` | ``` | ||
行 30: | 行 32: | ||
``` | ``` | ||
+ | |||
+ | ### / | ||
+ | |||
+ | ユーザーのホームディレクトリを置くため、データ領域の/ | ||
+ | ルート`/ | ||
+ | |||
+ | ``` | ||
+ | root@OpenWrt: | ||
+ | root@OpenWrt: | ||
+ | root@OpenWrt: | ||
+ | lrwxrwxrwx | ||
+ | root@OpenWrt: | ||
+ | |||
+ | ``` | ||
+ | |||
+ | ### 一般ユーザーを追加 | ||
+ | |||
+ | ``` | ||
+ | root@OpenWrt: | ||
+ | root@OpenWrt: | ||
+ | Changing password for hiroshi | ||
+ | New password: | ||
+ | Retype password: | ||
+ | passwd: password for hiroshi changed by root | ||
+ | root@OpenWrt: | ||
+ | hiroshi | ||
+ | root@OpenWrt: | ||
+ | |||
+ | ``` | ||
+ | |||
+ | ### 一般ユーザーにsudo権限付与 | ||
+ | |||
+ | / | ||
+ | |||
+ | ``` | ||
+ | root@OpenWrt: | ||
+ | ``` | ||
+ | |||
+ | この部分のコメントを外す。 | ||
+ | ``` | ||
+ | ## Uncomment to allow members of group sudo to execute any command | ||
+ | %sudo | ||
+ | |||
+ | ``` | ||
+ | |||
+ | sudoグループを作成し、一般ユーザーをsudoグループに追加 | ||
+ | |||
+ | ``` | ||
+ | root@OpenWrt: | ||
+ | root@OpenWrt: | ||
+ | root@OpenWrt: | ||
+ | uid=1000(hiroshi) gid=1000(hiroshi) groups=1000(hiroshi), | ||
+ | root@OpenWrt: | ||
+ | |||
+ | ``` | ||
+ | |||
+ | ### 一般ユーザーでSSHアクセスする | ||
+ | |||
+ | |||
+ | 一般ユーザーにsuして、 ~/ | ||
+ | |||
+ | ~/ | ||
+ | |||
+ | ``` | ||
+ | root@OpenWrt: | ||
+ | |||
+ | |||
+ | BusyBox v1.35.0 (2022-05-20 19:00:24 UTC) built-in shell (ash) | ||
+ | |||
+ | _______ | ||
+ | | ||
+ | | ||
+ | | ||
+ | |__| W I R E L E S S F R E E D O M | ||
+ | | ||
+ | | ||
+ | | ||
+ | hiroshi@OpenWrt:/ | ||
+ | hiroshi@OpenWrt:/ | ||
+ | hiroshi@OpenWrt:/ | ||
+ | <公開鍵の内容を貼り付ける> | ||
+ | hiroshi@OpenWrt:/ | ||
+ | hiroshi@OpenWrt:/ | ||
+ | ``` | ||
+ | |||
+ | 公開鍵は次のようにして作ることができる。(*.pubの方) | ||
+ | |||
+ | ``` | ||
+ | hiroshi@VPCF24AJ-ubuntu: | ||
+ | : | ||
+ | hiroshi@VPCF24AJ-ubuntu: | ||
+ | < | ||
+ | hiroshi@VPCF24AJ-ubuntu: | ||
+ | ``` | ||
+ | |||
+ | このように、一般ユーザーで OpenWrt へログインできるようになった。 | ||
+ | |||
+ | ``` | ||
+ | hiroshi@VPCF24AJ-ubuntu: | ||
+ | |||
+ | |||
+ | BusyBox v1.35.0 (2022-05-20 19:00:24 UTC) built-in shell (ash) | ||
+ | |||
+ | _______ | ||
+ | | ||
+ | | ||
+ | | ||
+ | |__| W I R E L E S S F R E E D O M | ||
+ | | ||
+ | | ||
+ | | ||
+ | hiroshi@OpenWrt:/ | ||
+ | hiroshi@OpenWrt:/ | ||
+ | Filesystem | ||
+ | / | ||
+ | hiroshi@OpenWrt:/ | ||
+ | |||
+ | ``` | ||
+ | |||
+ | ホームディレクトリは、RAID1を組んだReadyNASのHDD上にあるので、ディスク容量もたっぷりありますね。 | ||
+ | |||
+ | |||
+ | ### ホスト名でSSHアクセス | ||
+ | |||
+ | なんと、 openwrt.local でもアクセスできますね8-O | ||
+ | |||
+ | ``` | ||
+ | hiroshi@VPCF24AJ-ubuntu: | ||
+ | The authenticity of host ' | ||
+ | ED25519 key fingerprint is SHA256: | ||
+ | This host key is known by the following other names/ | ||
+ | ~/ | ||
+ | Are you sure you want to continue connecting (yes/ | ||
+ | Warning: Permanently added ' | ||
+ | |||
+ | |||
+ | BusyBox v1.35.0 (2022-05-20 19:00:24 UTC) built-in shell (ash) | ||
+ | |||
+ | _______ | ||
+ | | ||
+ | | ||
+ | | ||
+ | |__| W I R E L E S S F R E E D O M | ||
+ | | ||
+ | | ||
+ | | ||
+ | hiroshi@OpenWrt:/ | ||
+ | |||
+ | ``` | ||
+ | |||
+ | |||
+ | |||
+ | --- | ||
+ | |||
+ | ### 参考 | ||
+ | |||
+ | 下記サイトを参考にさせていただきました。 | ||
+ | |||
+ | https:// | ||
+ | |||
nas/readynas_duo_v2_openwrt_useradd.1653732356.txt.gz · 最終更新: 2022/05/28 19:05 by nipa28