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

LinuxのmountコマンドでWindowsの共有フォルダーが接続できなくなった現象を解決

Last updated at Posted at 2025-04-20

環境

  • ファイルサーバー
    • Windows Server 2025 Datacenter (試用中)
  • マウント先環境
    • Ubuntu Server 24.04.2

起こった現象

数か月前に、Ubuntuへネットワーク上に存在するファイルサーバー(Windowsで構築)をmountコマンドでマウントしていたが、メンテナンス時の再起動後にマウントできなくなった。
以下がその時のエラー。

mount error(127): Key has expired
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

パスワード有効期限の存在を完全に忘れていた。

解決

net user [ユーザー名]でWindows側のパスワード有効期限を確認する。
image.png
記事作成時、2025/04/20で2日ほど切れていたため、
パスワードを変更し有効期限を延ばすか、無期限化を行うことで解決した。

パスワード変更する方法

コマンドプロンプトかPowerShellを管理者権限で開く。
net user [ユーザー名] [パスワード] で変更。
image.png
変更できた。

パスワードの無期限化

PowerShellを管理者権限で開く。
Set-LocalUser -Name "ユーザー名" -PasswordNeverExpires $trueで無期限化できる。


※この記事は、AI文章校正ツール「ちゅらいと」で校正されています。

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