LoginSignup
3
1

More than 5 years have passed since last update.

chshでパスワードを聞かれるのはイヤ

Last updated at Posted at 2018-12-01

解決策

以下のコマンドを実行するだけ。

sudo sed --in-place -e '/auth.*required.*pam_shells.so/s/required/sufficient/g' /etc/pam.d/chsh

解説

/etc/pam.d/chshファイル内の

auth       required   pam_shells.so

の部分を

auth       sufficient   pam_shells.so

に変えてやればよい。テキストエディタ等でファイルを変更してもいいがコマンド一発で一発に済ますことのできる置換コマンドsedを使う。(vim標準機能の折りたたみを駆使して、.vimrcを整理しよう - Qiita)

パターンにマッチした行のみ、文字列1を文字列2に置換する

sed -e '/パターン/s/文字列1/文字列2/g' infile > outfile

ちなみに、--in-placeは上書きオプション

参照

command line - chsh always asking a password , and get PAM: Authentication failure - Ask Ubuntu
vim標準機能の折りたたみを駆使して、.vimrcを整理しよう - Qiita

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