新しいLinuxサーバーのユーザー権限

新しいLinuxサーバーのユーザー権限

LAMPスタックのみがインストールされている新しいLinuxサーバーへのSSHアクセス権を取得しました。 Drush、phpmyadminなどをインストールし、Webサーバーの一般的な構成は私次第でした。

私のSSHアクセスは提供されたユーザー名を介して行われます。新しいLinux VPSでは、次のような基本的なタスクを実行できないことがわかりました。

sudo vim /etc/apache2/sites-available/000-default.conf 
[sudo] password for axel: 
Sorry, user axel is not allowed to execute '/usr/bin/vim /etc/apache2/sites-available/000-default.conf' as root on IT-DEV-SERVER.

drushを使用しようとすると、同様のメッセージが表示されますdrush dl drupal-7.34

PS:Drushはrootユーザーアカウントを介してインストールされます。

ユーザーにコマンドを実行するために必要な権限を付与する方法を理解するのに役立つ人はいますか?

修正する:

@alur: visudoコマンドを実行すると、次のものが見つかります。

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbi$

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL
rick ALL=(ALL;ALL) ALL
owen ALL=(ALL;ALL) ALL
axel ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

Axelの「ALL」設定は、最初はSussiesとRickの設定と一致します。あなたの答えに合わせてAxelを調整しましたが、まだDrushを実行することはできません。それでもsudoでVIMを使用できます。

ベストアンサー1

rootアクセスが必要な場合、またはシステム管理者にユーザーアカウント「axel」にsudo権限を付与するように依頼してください。

rootアクセス権がある場合は、rootとしてログインしてvisudoコマンドを実行し、ファイルの末尾に次のように入力して、「axel」ユーザーがsudoを使用してvimを実行できるようにします。

axel  ALL = /usr/bin/vim

上記はvimでのみsudoを許可します。次の行を追加すると、「axel」にすべての権限を付与できます。

axel  ALL=(ALL) ALL

または、さらにグループを許可するには、次の項目を使用します。

axel  ALL=(ALL:ALL) ALL

おすすめ記事