Git Product home page Git Product logo

Comments (7)

thori0908 avatar thori0908 commented on September 15, 2024
No. command before after
1. mkdir work public_html public_html work
2. cd work [_@ip-_--*-** ~]$ cd work [_@ip-_--*-** work]$
3. vim hello.sh hello.sh
4. vim hello.sh
5. sh hello.sh hello world
6. chmod u+wx hello.sh hello.sh hello_copy.sh
7. cp hello.sh hello_copy.sh hello.sh hello.sh hello_copy.sh
8. mv hello.sh hello_move.sh hello.sh hello_move.sh hello_copy.sh hello_move.sh
9. rm work_move.sh hello_copy.sh hello_move.sh hello_copy.sh
10. cd hello.sh hello_copy.sh public_html work
11. cp -r work work_copy public_html work public_html work work_copy
12. mv work_copy work_move public_html work work_move public_html work work_move
13. rm -r work_move public_html work work_move public_html work
14. history
15. history | grep ls
16. man ls
17. sudo passwd ****
18. sudo smbpasswd -a ****

No.18のコマンド入力前に以下の手順でsamba をインストールし,起動させる.

  • /etc/yum.repos.d/にsernet-samba.repoを追加し,以下の内容を記述する.

    [sernet-samba]
    name=SerNet Samba Team packages (CentOS 5)
    type=rpm-md
    baseurl=http://ftp.sernet.de/pub/samba/3.5/centos/5
    enabled=1
    gpgcheck=0

  • sudo yum install samba sambaインストール

  • sudo /etc/init.d/smb start サーバー起動

参考:http://awstech.blogspot.jp/2012/10/amazonlinuxamisamba.html

from training.

fr-itaya avatar fr-itaya commented on September 15, 2024

コマンドはOKです!

実行前、実行後の確認や出力結果

ですが、下記の様な形で残すと、時系列で表示出来て見やすくなるのでやってみましょう。
例)

$ cd public_html/
$ ls -l
total 8
-rwx------ 1 *** *** 20 Apr  8 06:02 hello_copy.sh
-rwx------ 1 *** *** 20 Apr  8 05:30 hello_move.sh

実行前後の確認は、ファイルやディレクトリの情報を表示するコマンドを叩いて行います。
またこの研修は公開されているので、issueコメントに記載する場合は、user名とIPアドレスを伏せておきましょう。

@fr-sasaki sambaインストール&起動の部分、御確認お願い致します!

from training.

fr-sasaki avatar fr-sasaki commented on September 15, 2024

確認しました。samba部分も特に問題ないです。

ただ、上記のようにコマンドを打つ前と打った後の結果を貼り付けてみましょう。
こんな感じだと見やすいです。

1. ホームディレクトリの下にworkディレクトリを作成

$ ls -l
出力結果
$ mkdir work
$ ls -l
出力結果

2. workディレクトリ内に移動

$ pwd
出力結果
$ cd work
$ pwd
出力結果

from training.

thori0908 avatar thori0908 commented on September 15, 2024
  • No.1 ホームディレクトリの下にworkディレクトリを作成
$ ls -l
total 8
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
$ mkdir work
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:29 work
  • No.2 workディレクトリ内に移動
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:29 work
$ cd work
$ ls -l
total 0

  • No.3 その中にhello.shを作成
$ ls -l
total 0
$ vim hello.sh
$ ls -l
total 0
-rw-rw-r-- 1 **** **** 0 Sep  8 23:34 hello.sh
  • No.4 エディタを使いhello.shを次の通り編集 echo "hello world";
  1 echo "hello world";
~                                                                               
~                                                                               
~                                                                            
  • No.5 hello.shをコマンドで実行
$ sh hello.sh
hello world

  • No.6 自分以外のユーザーがhello.shを読み書き実行出来ないようパーミッションを変更

ls -l
total 4
-rw-rw-r-- 1 **** **** 20 Sep  8 23:37 hello.sh
$ chmod u+wx hello.sh
$ ls -l
total 4
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello.sh

  • No.7 hello.shをhello_copy.shにコピー
ls -l
total 4
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello.sh
$ cp hello.sh hello_copy.sh
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
  • No.8 hello.shをhello_move.shにリネーム
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
$ mv hello.sh hello_move.sh
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello_move.sh

  • No.9 hello_move.shを削除
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello_move.sh
$ rm work_move.sh
rm: cannot remove 'work_move.sh': No such file or directory
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello_move.sh

  • No.10 ホームディレクトリに戻る
$ ls -l 
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello_move.sh
$ cd
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
  • No.11 workディレクトリをwork_copyにコピー
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
$ cp -r work work_copy
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep  8 23:50 work_copy
  • No.12 work_copyディレクトリをwork_moveにリネーム
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep  8 23:50 work_copy
$ mv work_copy work_move 
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep  8 23:50 work_move

  • No.13 work_moveディレクトリを削除
ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep  8 23:50 work_move
$ rm -r work_move
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
  • No.14 今まで発行したコマンドの履歴を確認
$ history
    1  exit
    2  cd

  • No.15 14からlsコマンドを使用した行だけを表示
$ history | grep ls
   21  ls
   23  ls

  • No.16 lsコマンドのヘルプを表示
$ man ls

LS(1)                            User Commands                           LS(1)

NAME
       ls - list directory contents
  • No.17 自分のアカウントのパスワードを変更
$ sudo passwd ****
  • No.18 自分のsambaアカウントを追加
$ sudo smbpasswd -a ****

No.18のコマンド入力前に以下の手順でsamba をインストールし,起動させる.

  • /etc/yum.repos.d/にsernet-samba.repoを追加し,以下の内容を記述する.

    [sernet-samba]
    name=SerNet Samba Team packages (CentOS 5)
    type=rpm-md
    baseurl=http://ftp.sernet.de/pub/samba/3.5/centos/5
    enabled=1
    gpgcheck=0

  • sudo yum install samba sambaインストール

  • sudo /etc/init.d/smb start サーバー起動

参考:http://awstech.blogspot.jp/2012/10/amazonlinuxamisamba.html

from training.

fr-itaya avatar fr-itaya commented on September 15, 2024

確認しました!2点気になったところがあるので直してみましょう。

No.6 

今回は所有者(=自分)に実行権限を付与する他に、それ以外のユーザに読み書きの権限を許可しない設定が必要です。
各ユーザの権限を1回のコマンドで設定する方法があるので、試してみてください!:+1:

No.9

存在しないファイル名を指定しているようです。

from training.

thori0908 avatar thori0908 commented on September 15, 2024
  • No.1 ホームディレクトリの下にworkディレクトリを作成
$ ls -l
total 8
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
$ mkdir work
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:29 work
  • No.2 workディレクトリ内に移動
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:29 work
$ cd work
$ ls -l
total 0

  • No.3 その中にhello.shを作成
$ ls -l
total 0
$ vim hello.sh
$ ls -l
total 0
-rw-rw-r-- 1 **** **** 0 Sep  8 23:34 hello.sh
  • No.4 エディタを使いhello.shを次の通り編集 echo "hello world";
  1 echo "hello world";
~                                                                               
~                                                                               
~                                                                            
  • No.5 hello.shをコマンドで実行
$ sh hello.sh
hello world

  • No.6 自分以外のユーザーがhello.shを読み書き実行出来ないようパーミッションを変更
$ ls -l
total 4
-rw-rw-r-- 1 **** ****  0 Sep 11 18:12 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
$ chmod 700 hello.sh  
$ ls -l
total 4
-rwx------ 1 **** ****  0 Sep 11 18:12 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh

ref.
http://itpro.nikkeibp.co.jp/article/COLUMN/20060227/230728/
http://motw.mods.jp/UNIX/chmod.html

  • No.7 hello.shをhello_copy.shにコピー
ls -l
total 4
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello.sh
$ cp hello.sh hello_copy.sh
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
  • No.8 hello.shをhello_move.shにリネーム
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
$ mv hello.sh hello_move.sh
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello_move.sh

  • No.9 hello_move.shを削除
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello_move.sh
$ rm hello_move.sh
$ ls -l
total 4
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
  • No.10 ホームディレクトリに戻る
$ ls -l 
total 8
-rwxrw-r-- 1 **** **** 20 Sep  8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep  8 23:37 hello_move.sh
$ cd
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
  • No.11 workディレクトリをwork_copyにコピー
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
$ cp -r work work_copy
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep  8 23:50 work_copy
  • No.12 work_copyディレクトリをwork_moveにリネーム
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep  8 23:50 work_copy
$ mv work_copy work_move 
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep  8 23:50 work_move

  • No.13 work_moveディレクトリを削除
ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep  8 23:50 work_move
$ rm -r work_move
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug  8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep  8 23:45 work
  • No.14 今まで発行したコマンドの履歴を確認
$ history
    1  exit
    2  cd

  • No.15 14からlsコマンドを使用した行だけを表示
$ history | grep ls
   21  ls
   23  ls

  • No.16 lsコマンドのヘルプを表示
$ man ls

LS(1)                            User Commands                           LS(1)

NAME
       ls - list directory contents
  • No.17 自分のアカウントのパスワードを変更
$ sudo passwd ****
  • No.18 自分のsambaアカウントを追加
$ sudo smbpasswd -a ****

No.18のコマンド入力前に以下の手順でsamba をインストールし,起動させる.

  • /etc/yum.repos.d/にsernet-samba.repoを追加し,以下の内容を記述する.

    [sernet-samba]
    name=SerNet Samba Team packages (CentOS 5)
    type=rpm-md
    baseurl=http://ftp.sernet.de/pub/samba/3.5/centos/5
    enabled=1
    gpgcheck=0

  • sudo yum install samba sambaインストール

  • sudo /etc/init.d/smb start サーバー起動

参考:http://awstech.blogspot.jp/2012/10/amazonlinuxamisamba.html

from training.

fr-itaya avatar fr-itaya commented on September 15, 2024

OKです!:+1:

@fr-sasaki @fr-matsuo 確認お願いします!

from training.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.