FreeBSD में doas इंस्टॉल करें

4 min

language: ja bn en es hi pt ru zh-cn zh-tw

नमस्ते, मैं अक्षम हूँ।
FreeBSD में sudo का उपयोग किया जा सकता है, लेकिन कमांड के साथ काम करते समय, उदाहरण के लिए, यदि आप टर्मिनल पर बगल के टैब में GNU/Linux वातावरण में काम कर रहे हैं और FreeBSD को भी उसी sudo कमांड से चलाया जा सकता है, तो अनपेक्षित संचालन की संभावना उत्पन्न होती है। इसलिए, doas का उपयोग करके sudo के माध्यम से प्रशासनिक विशेषाधिकारों को अक्षम करना अधिक सुरक्षित लगता है, इसलिए मैं doas का उपयोग करूँगा।
यह FreeBSD फोरम में भी चर्चा का विषय रहा है।

pkg के साथ इंस्टॉल करें

जापानी में यह Qiita लेख बहुत विस्तृत स्पष्टीकरण प्रदान करता है।

# pkg install doas
Updating FreeBSD repository catalogue...
Fetching data.pkg: 100%    7 MiB   7.5MB/s    00:01    
Processing entries: 100%
FreeBSD repository update completed. 35521 packages processed.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        doas: 6.3p12

Number of packages to be installed: 1

24 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching doas-6.3p12.pkg: 100%   24 KiB  24.6kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/1] Installing doas-6.3p12...
[1/1] Extracting doas-6.3p12: 100%
=====
Message from doas-6.3p12:

--
To use doas,

/usr/local/etc/doas.conf

must be created. Refer to doas.conf(5) for further details and/or follow
/usr/local/etc/doas.conf.sample as an example.

Note: In order to be able to run most desktop (GUI) applications, the user
needs to have the keepenv keyword specified. If keepenv is not specified then
key elements, like the user's $HOME variable, will be reset and cause the GUI
application to crash.

Users who only need to run command line applications can usually get away
without keepenv.

When in doubt, try to avoid using keepenv as it is less secure to have
environment variables passed to privileged users.

और फिर, /usr/local/etc/doas.conf को संपादित करें और इसे इस प्रकार लिखें।

permit keepenv username

निष्पादन

अब, निर्दिष्ट उपयोगकर्ता पर स्विच करें और doas command को चलाने का प्रयास करें।

$ su - username
$ doas vim /usr/local/etc/doas.conf
Password:

पासवर्ड दर्ज करने के बाद, यह सफलतापूर्वक निष्पादित हो गया।

Related Posts