質問編集履歴

9

タグの追加

2016/11/14 08:04

投稿

dlrowolleh
dlrowolleh

スコア120

test CHANGED
File without changes
test CHANGED
@@ -137,3 +137,47 @@
137
137
 
138
138
 
139
139
  何卒よろしくお願いします
140
+
141
+
142
+
143
+ #追記
144
+
145
+ `$ cat /var/log/cron`
146
+
147
+ `cat: /var/log/cron: そのようなファイルやディレクトリはありません`
148
+
149
+ と表示されました。
150
+
151
+ 調べていくうちに
152
+
153
+ `/etc/init.d/cron start`
154
+
155
+ と書いてあり、
156
+
157
+ [Ubuntu@11 決まった時間に自動で電源を切る cronでshutdown - Cotton ...](http://cpw.hatenablog.com/entry/20120425/1335280082)
158
+
159
+
160
+
161
+ `$ vi /etc/crontab `
162
+
163
+ `$ /etc/init.d/cron start`
164
+
165
+ `[ ok ] Starting cron (via systemctl): cron.service.`
166
+
167
+
168
+
169
+ やってみたのですが、
170
+
171
+ 電源は切れませんでした。
172
+
173
+
174
+
175
+ `$ mail`
176
+
177
+ `No mail for h28-hashimoto`
178
+
179
+ `$ cat /var/log/cron
180
+
181
+ cat: /var/log/cron: そのようなファイルやディレクトリはありません`
182
+
183
+ でした。

8

編集

2016/11/14 08:04

投稿

dlrowolleh
dlrowolleh

スコア120

test CHANGED
@@ -1 +1 @@
1
- Cronで自動シャットダウンできない
1
+ 【Ubuntu】Cronで自動シャットダウンできない
test CHANGED
File without changes

7

修正

2016/11/14 04:42

投稿

dlrowolleh
dlrowolleh

スコア120

test CHANGED
@@ -1 +1 @@
1
- LinuxのPCを時間を指定して自動シャットダウンする方法を教えてくださ
1
+ Cron自動シャットダウンできな
test CHANGED
@@ -8,105 +8,7 @@
8
8
 
9
9
  ###試したこと
10
10
 
11
- 0. シャットダウンコマンドをcronで実行しようとしました。
12
-
13
- 参考:[linuxの自動シャットダウンについて教えてください
14
-
15
- ](http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1470731414)
16
-
17
- ```
18
-
19
- $ crontab -e
11
+ `$ crontab -e`
20
-
21
- 40 19 * * * shutdown -h now
22
-
23
- crontab: installing new crontab
24
-
25
-
26
-
27
- ```
28
-
29
- では
30
-
31
- 時間になっても電源は切れませんでした。
32
-
33
- また、
34
-
35
-
36
-
37
- ```
38
-
39
- $ mail
40
-
41
-
42
-
43
- ```
44
-
45
- でエラーの内容を見たところ、
46
-
47
-
48
-
49
- ```
50
-
51
- /bin/sh: 1: shutdown: not found
52
-
53
-
54
-
55
- ```
56
-
57
- でした。
58
-
59
-
60
-
61
- そのため、
62
-
63
-
64
-
65
- 0. シャットダウンするスクリプトを作成してcronでそのスクリプトを実行しようとしました。
66
-
67
-
68
-
69
- ```
70
-
71
- $ vi Desktop/2016/sample/shutdown.sh
72
-
73
-
74
-
75
- ```
76
-
77
-
78
-
79
- ```bash
80
-
81
- #!/bin/bash -x
82
-
83
- shutdown -h now
84
-
85
-
86
-
87
- ```
88
-
89
-
90
-
91
- ```
92
-
93
- $ chmod +x shutdown.sh
94
-
95
-
96
-
97
- ```
98
-
99
- で実行権限を与え
100
-
101
-
102
-
103
- ```
104
-
105
- $ crontab -e
106
-
107
-
108
-
109
- ```
110
12
 
111
13
 
112
14
 
@@ -114,83 +16,63 @@
114
16
 
115
17
  ```
116
18
 
19
+ # Edit this file to introduce tasks to be run by cron.
20
+
21
+ #
22
+
23
+ # Each task to run has to be defined through a single line
24
+
25
+ # indicating with different fields when the task will be run
26
+
27
+ # and what command to run for the task
28
+
29
+ #
30
+
31
+ # To define the time you can provide concrete values for
32
+
33
+ # minute (m), hour (h), day of month (dom), month (mon),
34
+
35
+ # and day of week (dow) or use '*' in these fields (for 'any').#
36
+
37
+ # Notice that tasks will be started based on the cron's system
38
+
39
+ # daemon's notion of time and timezones.
40
+
41
+ #
42
+
43
+ # Output of the crontab jobs (including errors) is sent through
44
+
45
+ # email to the user the crontab file belongs to (unless redirected).
46
+
47
+ #
48
+
49
+ # For example, you can run a backup of all your user accounts
50
+
51
+ # at 5 a.m every week with:
52
+
117
- 08 20 * * * cd /home/h28-sotuken/Desktop/2016/sample; ./shutdown.sh
53
+ # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
54
+
55
+ #
56
+
57
+ # For more information see the manual pages of crontab(5) and cron(8)
58
+
59
+ #
60
+
61
+ # m h dom mon dow command
118
62
 
119
63
 
120
64
 
121
- ```
65
+ PATH=/bin:/sbin:/usr/bin:/usr/sbin
122
66
 
123
- としましたが時間になっても電源は切れませんでした。
67
+ 27 13 * * * shutdown -h now
124
-
125
-
126
68
 
127
69
  ```
128
70
 
129
- $ mail
71
+ これではシャットダウンできませんでした。
130
72
 
131
-
132
-
133
- ```
73
+ `$ mail`
134
-
135
- でエラーの内容を見たところ、
136
-
137
-
138
-
139
- ```
140
-
141
- + shutdown -h now
142
-
143
- ./shutdown.sh: 行 3: shutdown: コマンドが見つかりません
144
-
145
-
146
-
147
- ```
148
-
149
- しかし、
150
-
151
-
152
-
153
- ```
154
-
155
- $ cd /home/(ユーザ名)/Desktop/2016/sample; ./shutdown.sh
156
-
157
-
158
-
159
- ```
160
74
 
161
75
  では
162
-
163
- rootのパスワードを聞かれず(何故だか気になりますが…)電源が切れました
164
-
165
-
166
-
167
- ###補足情報(言語/FW/ツール等のバージョンなど)
168
-
169
- Ubutu15.10です。
170
-
171
- デスクトップ環境です。
172
-
173
-
174
-
175
- 何卒よろしくお願いします。
176
-
177
- ###追記(11/11)
178
-
179
- `crontab -e`
180
-
181
-
182
-
183
- ```
184
-
185
- 01 15 * * * /sbin/shutdown -h now
186
-
187
- ```
188
-
189
- と編集してみたところ、
190
-
191
- シャットダウンできませんでした。
192
-
193
- `$ mail`
194
76
 
195
77
  ```
196
78
 
@@ -200,244 +82,58 @@
200
82
 
201
83
  ```
202
84
 
203
- と、エラーメールが来ました。
204
-
205
- [cronジョブを作るのにいつものやり方でいいんですか? - Qiita](http://qiita.com/jmatsu/items/0a5d80abe188b09644c1)
206
-
207
- という情報を見つけ、
208
-
209
- `$ vi /etc/crontab `
210
-
211
- をやってみたところ
212
-
213
- ```
214
-
215
- # /etc/crontab: system-wide crontab$
216
-
217
- # Unlike any other crontab you don't have to run the `crontab'$
218
-
219
- # command to install the new version when you edit this file$
220
-
221
- # and files in /etc/cron.d. These files also have username fields,$
222
-
223
- # that none of the other crontabs do.$
224
-
225
- $
226
-
227
- SHELL=/bin/sh$
228
-
229
- PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin$
230
-
231
- $
232
-
233
- # m h dom mon dow user^Icommand$
234
-
235
- 17 *^I* * *^Iroot cd / && run-parts --report /etc/cron.hourly$
236
-
237
- 25 6^I* * *^Iroot^Itest -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )$
238
-
239
- 47 6^I* * 7^Iroot^Itest -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )$
240
-
241
- 52 6^I1 * *^Iroot^Itest -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )$
242
-
243
- #自分で追加した項目$
244
-
245
- 40 18 * * * root /sbin/shutdown -h now$
246
-
247
- ```
248
-
249
- となっていました。
250
-
251
-
252
-
253
- また、
254
-
255
- ```
256
-
257
- $ which reboot
258
-
259
- /sbin/reboot
260
-
261
- ```
262
-
263
- ```
264
-
265
- $ which shutdown
266
-
267
- /sbin/shutdown
268
-
269
- ```
270
-
271
- また、
272
-
273
- `$ sudo visudo
274
-
275
- [sudo] password for (ユーザ名):`
276
-
277
- ```
278
-
279
- #$
280
-
281
- # This file MUST be edited with the 'visudo' command as root.$
282
-
283
- #$
284
-
285
- # Please consider adding local content in /etc/sudoers.d/ instead of$
286
-
287
- # directly modifying this file.$
288
-
289
- #$
290
-
291
- # See the man page for details on how to write a sudoers file.$
292
-
293
- #$
294
-
295
- Defaults^Ienv_reset$
296
-
297
- Defaults^Imail_badpass$
298
-
299
- Defaults^Isecure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"$
300
-
301
- $
302
-
303
- # Host alias specification$
304
-
305
- $
306
-
307
- # User alias specification$
308
-
309
- $
310
-
311
- # Cmnd alias specification$
312
-
313
- $
314
-
315
- # User privilege specification$
316
-
317
- root^IALL=(ALL:ALL) ALL$
318
-
319
- $
320
-
321
- # Members of the admin group may gain root privileges$
322
-
323
- %admin ALL=(ALL) ALL$
324
-
325
- $
326
-
327
- # Allow members of group sudo to execute any command$
328
-
329
- %sudo^IALL=(ALL:ALL) ALL$
330
-
331
- $
332
-
333
- # See sudoers(5) for more information on "#include" directives:$
334
-
335
- $
336
-
337
- #includedir /etc/sudoers.d$
338
-
339
- ```
340
-
341
-
342
-
343
- `visudo: /etc/sudoers.tmp は変更されません`
344
-
345
- となりました。
346
-
347
-
348
-
349
- `$ crontab -e`
350
-
351
-
352
-
353
- `05 19 * * * root /sbin/shutdown -h now`
354
-
355
- としてみたところ
356
-
357
- `$ mail`
358
-
359
- で確認すると
360
-
361
- `/bin/sh: 1: root: not found`
362
-
363
- となっていました。
364
-
365
-
366
-
367
- また、
368
-
369
- `$ vi /etc/crontab`
370
-
371
-
372
-
373
- `20 19 * * * root /sbin/shutdown -h now`
374
-
375
- としてみたのですが、
376
-
377
- シャットダウンできませんでした。
378
-
379
- `$ mail`
380
-
381
- で確認すると
382
-
383
- `No mail for (ユーザ名)`
384
-
385
85
  でした。
386
86
 
387
87
 
388
88
 
389
- #追記
390
-
391
- `$ sudo visudo`
89
+ `$ vi /etc/crontab`
392
-
393
-
394
90
 
395
91
  ```
396
92
 
93
+ # /etc/crontab: system-wide crontab
94
+
95
+ # Unlike any other crontab you don't have to run the `crontab'
96
+
97
+ # command to install the new version when you edit this file
98
+
99
+ # and files in /etc/cron.d. These files also have username fields,
100
+
101
+ # that none of the other crontabs do.
102
+
103
+
104
+
105
+ SHELL=/bin/sh
106
+
107
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
108
+
109
+
110
+
111
+ # m h dom mon dow user>-command
112
+
113
+ 17 *>---* * *>--root cd / && run-parts --report /etc/cron.hourly
114
+
115
+ 25 6>---* * *>--root>---test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
116
+
117
+ 47 6>---* * 7>--root>---test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
118
+
119
+ 52 6>---1 * *>--root>---test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
120
+
121
+
122
+
397
- hoge2-hasimoto ALL = NOPASSWD: /sbin/shutdown -h now
123
+ 30 13 * * * root /sbin/shutdown -h now
398
124
 
399
125
  ```
400
126
 
401
- と設定しました。(行末ですが大丈夫?)
127
+ でもシャットダウンできせんでした。
402
128
 
403
- ちなみに、
129
+ `$ mail`
404
130
 
405
131
  ```
406
132
 
407
- $ echo $USER
133
+ No mail for (ユーザ名)
408
-
409
- hoge2-hasimoto
410
134
 
411
135
  ```
412
136
 
413
- です(文字に色がつかなかったのにものすごい違和感を感じます…。)
414
-
415
- その後、
416
-
417
- `$ crontab -e`
418
-
419
-
420
137
 
421
138
 
422
-
423
- `31 20 * * * /sbin/shutdown -h now`
424
-
425
-
426
-
427
-
428
-
429
- `$ mail`
430
-
431
- で確認すると
432
-
433
- `Failed to execute operation: Interactive authentication required.
434
-
435
- Must be root.`
436
-
437
- でした。
438
-
439
-
440
-
441
- 長くなりましてすみません。
442
-
443
139
  何卒よろしくお願いします

6

編集

2016/11/14 04:41

投稿

dlrowolleh
dlrowolleh

スコア120

test CHANGED
File without changes
test CHANGED
@@ -383,3 +383,61 @@
383
383
  `No mail for (ユーザ名)`
384
384
 
385
385
  でした。
386
+
387
+
388
+
389
+ #追記
390
+
391
+ `$ sudo visudo`
392
+
393
+
394
+
395
+ ```
396
+
397
+ hoge2-hasimoto ALL = NOPASSWD: /sbin/shutdown -h now
398
+
399
+ ```
400
+
401
+ と設定しました。(行末ですが大丈夫?)
402
+
403
+ ちなみに、
404
+
405
+ ```
406
+
407
+ $ echo $USER
408
+
409
+ hoge2-hasimoto
410
+
411
+ ```
412
+
413
+ です(文字に色がつかなかったのにものすごい違和感を感じます…。)
414
+
415
+ その後、
416
+
417
+ `$ crontab -e`
418
+
419
+
420
+
421
+
422
+
423
+ `31 20 * * * /sbin/shutdown -h now`
424
+
425
+
426
+
427
+
428
+
429
+ `$ mail`
430
+
431
+ で確認すると
432
+
433
+ `Failed to execute operation: Interactive authentication required.
434
+
435
+ Must be root.`
436
+
437
+ でした。
438
+
439
+
440
+
441
+ 長くなりましてすみません。
442
+
443
+ 何卒よろしくお願いします

5

報告

2016/11/11 11:43

投稿

dlrowolleh
dlrowolleh

スコア120

test CHANGED
File without changes
test CHANGED
@@ -361,3 +361,25 @@
361
361
  `/bin/sh: 1: root: not found`
362
362
 
363
363
  となっていました。
364
+
365
+
366
+
367
+ また、
368
+
369
+ `$ vi /etc/crontab`
370
+
371
+
372
+
373
+ `20 19 * * * root /sbin/shutdown -h now`
374
+
375
+ としてみたのですが、
376
+
377
+ シャットダウンできませんでした。
378
+
379
+ `$ mail`
380
+
381
+ で確認すると
382
+
383
+ `No mail for (ユーザ名)`
384
+
385
+ でした。

4

追記修正

2016/11/11 10:24

投稿

dlrowolleh
dlrowolleh

スコア120

test CHANGED
File without changes
test CHANGED
@@ -168,6 +168,8 @@
168
168
 
169
169
  Ubutu15.10です。
170
170
 
171
+ デスクトップ環境です。
172
+
171
173
 
172
174
 
173
175
  何卒よろしくお願いします。

3

tuiki

2016/11/11 10:17

投稿

dlrowolleh
dlrowolleh

スコア120

test CHANGED
File without changes
test CHANGED
@@ -341,3 +341,21 @@
341
341
  `visudo: /etc/sudoers.tmp は変更されません`
342
342
 
343
343
  となりました。
344
+
345
+
346
+
347
+ `$ crontab -e`
348
+
349
+
350
+
351
+ `05 19 * * * root /sbin/shutdown -h now`
352
+
353
+ としてみたところ
354
+
355
+ `$ mail`
356
+
357
+ で確認すると
358
+
359
+ `/bin/sh: 1: root: not found`
360
+
361
+ となっていました。

2

修正

2016/11/11 10:16

投稿

dlrowolleh
dlrowolleh

スコア120

test CHANGED
File without changes
test CHANGED
@@ -341,75 +341,3 @@
341
341
  `visudo: /etc/sudoers.tmp は変更されません`
342
342
 
343
343
  となりました。
344
-
345
- #余談
346
-
347
-
348
-
349
- 0. `$ reboot`でパスワードを求められず再起動ができる(sudoなし)
350
-
351
- 0. `$ shutdown`でパスワードを求められずシャットダウンができる(sudoなし)
352
-
353
- 0. (シャットダウンとは関係ないがsudoに関して)
354
-
355
-
356
-
357
- `$ sudo apt-get update`←sudo実行
358
-
359
- `[sudo] password for (ユーザ名):`←パスワードを聞かれる
360
-
361
- 〜省略(処理中)〜
362
-
363
- `パッケージリストを読み込んでいます... 完了`
364
-
365
-
366
-
367
-
368
-
369
- `$ sudo apt-get update`←sudo実行(パスワードを聞かれない)
370
-
371
- 〜省略(処理中)〜
372
-
373
- `パッケージリストを読み込んでいます... 完了`
374
-
375
-
376
-
377
-
378
-
379
- `$ apt-get update`←sudo実行してない
380
-
381
- 〜省略(処理中)〜
382
-
383
- `パッケージリストを読み込んでいます... 完了`
384
-
385
-
386
-
387
- `$ exit`←端末終了
388
-
389
- 〜端末起動〜
390
-
391
- `$ sudo apt-get update`←sudo実行
392
-
393
- `[sudo] password for (ユーザ名):`←パスワードを聞かれる
394
-
395
- 〜省略(処理中)〜
396
-
397
- `パッケージリストを読み込んでいます... 完了`
398
-
399
-
400
-
401
- というsudoが本来なら必要(?)な処理をする際にsudoをつけなくても処理が始まったり、
402
-
403
- sudo実行後にはパスワードを聞かれるはず(?)なのにパスワードを聞かれずに処理が始まる
404
-
405
-
406
-
407
- という事態が発生しています。
408
-
409
- 原因はなんでしょうか…。(これが普通なのか?)
410
-
411
- 少し気になります。
412
-
413
- たくさん書いてしまいすみません。
414
-
415
- 何卒よろしくお願いします。

1

追記修正

2016/11/11 08:02

投稿

dlrowolleh
dlrowolleh

スコア120

test CHANGED
File without changes
test CHANGED
@@ -171,3 +171,245 @@
171
171
 
172
172
 
173
173
  何卒よろしくお願いします。
174
+
175
+ ###追記(11/11)
176
+
177
+ `crontab -e`
178
+
179
+
180
+
181
+ ```
182
+
183
+ 01 15 * * * /sbin/shutdown -h now
184
+
185
+ ```
186
+
187
+ と編集してみたところ、
188
+
189
+ シャットダウンできませんでした。
190
+
191
+ `$ mail`
192
+
193
+ ```
194
+
195
+ Failed to execute operation: Interactive authentication required.
196
+
197
+ Must be root.
198
+
199
+ ```
200
+
201
+ と、エラーメールが来ました。
202
+
203
+ [cronジョブを作るのにいつものやり方でいいんですか? - Qiita](http://qiita.com/jmatsu/items/0a5d80abe188b09644c1)
204
+
205
+ という情報を見つけ、
206
+
207
+ `$ vi /etc/crontab `
208
+
209
+ をやってみたところ
210
+
211
+ ```
212
+
213
+ # /etc/crontab: system-wide crontab$
214
+
215
+ # Unlike any other crontab you don't have to run the `crontab'$
216
+
217
+ # command to install the new version when you edit this file$
218
+
219
+ # and files in /etc/cron.d. These files also have username fields,$
220
+
221
+ # that none of the other crontabs do.$
222
+
223
+ $
224
+
225
+ SHELL=/bin/sh$
226
+
227
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin$
228
+
229
+ $
230
+
231
+ # m h dom mon dow user^Icommand$
232
+
233
+ 17 *^I* * *^Iroot cd / && run-parts --report /etc/cron.hourly$
234
+
235
+ 25 6^I* * *^Iroot^Itest -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )$
236
+
237
+ 47 6^I* * 7^Iroot^Itest -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )$
238
+
239
+ 52 6^I1 * *^Iroot^Itest -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )$
240
+
241
+ #自分で追加した項目$
242
+
243
+ 40 18 * * * root /sbin/shutdown -h now$
244
+
245
+ ```
246
+
247
+ となっていました。
248
+
249
+
250
+
251
+ また、
252
+
253
+ ```
254
+
255
+ $ which reboot
256
+
257
+ /sbin/reboot
258
+
259
+ ```
260
+
261
+ ```
262
+
263
+ $ which shutdown
264
+
265
+ /sbin/shutdown
266
+
267
+ ```
268
+
269
+ また、
270
+
271
+ `$ sudo visudo
272
+
273
+ [sudo] password for (ユーザ名):`
274
+
275
+ ```
276
+
277
+ #$
278
+
279
+ # This file MUST be edited with the 'visudo' command as root.$
280
+
281
+ #$
282
+
283
+ # Please consider adding local content in /etc/sudoers.d/ instead of$
284
+
285
+ # directly modifying this file.$
286
+
287
+ #$
288
+
289
+ # See the man page for details on how to write a sudoers file.$
290
+
291
+ #$
292
+
293
+ Defaults^Ienv_reset$
294
+
295
+ Defaults^Imail_badpass$
296
+
297
+ Defaults^Isecure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"$
298
+
299
+ $
300
+
301
+ # Host alias specification$
302
+
303
+ $
304
+
305
+ # User alias specification$
306
+
307
+ $
308
+
309
+ # Cmnd alias specification$
310
+
311
+ $
312
+
313
+ # User privilege specification$
314
+
315
+ root^IALL=(ALL:ALL) ALL$
316
+
317
+ $
318
+
319
+ # Members of the admin group may gain root privileges$
320
+
321
+ %admin ALL=(ALL) ALL$
322
+
323
+ $
324
+
325
+ # Allow members of group sudo to execute any command$
326
+
327
+ %sudo^IALL=(ALL:ALL) ALL$
328
+
329
+ $
330
+
331
+ # See sudoers(5) for more information on "#include" directives:$
332
+
333
+ $
334
+
335
+ #includedir /etc/sudoers.d$
336
+
337
+ ```
338
+
339
+
340
+
341
+ `visudo: /etc/sudoers.tmp は変更されません`
342
+
343
+ となりました。
344
+
345
+ #余談
346
+
347
+
348
+
349
+ 0. `$ reboot`でパスワードを求められず再起動ができる(sudoなし)
350
+
351
+ 0. `$ shutdown`でパスワードを求められずシャットダウンができる(sudoなし)
352
+
353
+ 0. (シャットダウンとは関係ないがsudoに関して)
354
+
355
+
356
+
357
+ `$ sudo apt-get update`←sudo実行
358
+
359
+ `[sudo] password for (ユーザ名):`←パスワードを聞かれる
360
+
361
+ 〜省略(処理中)〜
362
+
363
+ `パッケージリストを読み込んでいます... 完了`
364
+
365
+
366
+
367
+
368
+
369
+ `$ sudo apt-get update`←sudo実行(パスワードを聞かれない)
370
+
371
+ 〜省略(処理中)〜
372
+
373
+ `パッケージリストを読み込んでいます... 完了`
374
+
375
+
376
+
377
+
378
+
379
+ `$ apt-get update`←sudo実行してない
380
+
381
+ 〜省略(処理中)〜
382
+
383
+ `パッケージリストを読み込んでいます... 完了`
384
+
385
+
386
+
387
+ `$ exit`←端末終了
388
+
389
+ 〜端末起動〜
390
+
391
+ `$ sudo apt-get update`←sudo実行
392
+
393
+ `[sudo] password for (ユーザ名):`←パスワードを聞かれる
394
+
395
+ 〜省略(処理中)〜
396
+
397
+ `パッケージリストを読み込んでいます... 完了`
398
+
399
+
400
+
401
+ というsudoが本来なら必要(?)な処理をする際にsudoをつけなくても処理が始まったり、
402
+
403
+ sudo実行後にはパスワードを聞かれるはず(?)なのにパスワードを聞かれずに処理が始まる
404
+
405
+
406
+
407
+ という事態が発生しています。
408
+
409
+ 原因はなんでしょうか…。(これが普通なのか?)
410
+
411
+ 少し気になります。
412
+
413
+ たくさん書いてしまいすみません。
414
+
415
+ 何卒よろしくお願いします。