Skip to main content

Posts

Showing posts with the label Linux

How to configure passwordless login in Mac OS X and Linux

  Overview This article walks through configuring your website user's SSH connection to your DreamHost server so you will no longer have to enter your password. Background Once you set up a  shell user  and try to log in via  SSH , you'll find you must enter your password each time. If you’d like to avoid entering your password every time, you can set up Passwordless Login. This way, you'll be able to automatically log in immediately without needing to enter your password. How to configure passwordless login The following instructions configure Passwordless Login for any Unix, Linux, OSX, or Cygwin machine. In this article,  username@server.dreamhost.com  is used as the login example. Make sure to replace username with your actual  shell username . Make sure to replace the servername with your  DreamHost servername . Additionally, you can use the default key name of  id_ed25519  or create a custom key name. Make sure you use the key name...

pivot_root vs chroot vs switch_root

The chroot command modifies the root directory for a process, limiting its access to the rest of the filesystem. This is useful for security, containerization, or testing purposes. The process running under chroot has no knowledge of anything outside its jail, making it appear as if it is running on the root filesystem. pivot_root vs chroot vs switch_root 1 2 3 In Linux, pivot_root, chroot, and switch_root are commands used to change the root filesystem of a process. Each has its specific use cases and functionalities. pivot_root The pivot_root command is used to change the root filesystem of the current process and its children. It swaps the current root filesystem with a new one, making the old root accessible at a specified location. This command is typically used during the boot process when the system transitions from an initial ramdisk (initrd) to the real root filesystem 1 . Example: mount  /dev/hda1 /new-root cd  /new-root pivot_root . old-root exec chroot  . sh ...

Vim Copy & Paste Terminology

The keyboard shortcuts to copy, cut, and paste can be boiled down into three characters that utilize Vim-specific terminology. Understanding these terms will help you recall the correct keyboard shortcut. Y stands for “yank” in Vim, which is conceptually similar to copying. D stands for “delete” in Vim, which is conceptually similar to cutting. P stands for “put” in Vim, which is conceptually similar to pasting. I deliberately use the phrase “conceptually similar to” because these actions are not one and the same. If you want to dive deeper into this explanation, scroll down to the section below titled “What Happens Under the Hood?” Copy, Cutting, and Pasting in Vim/Vi - The Basics 1.Press esc to return to normal mode. Any character typed in normal mode will be interpreted as a vim command. 2.Navigate your cursor to the beginning of where you want to copy or cut. 3.To enter visual mode, you have 3 options. We suggest using visual mode because the selected characters are highlighted, an...

What is avahi in Linux?

avahi is a Linux implementation of a   protocol   also known as "Rendezvous" or "Bonjour"). Its goal is to let devices, connected to the local network, broadcast their IP-address together with their   function . Hence the printer can from time to time broadcasts : My IP is   192.168.23.45   and I can print any postscript document with ipp prottocol; a NAS can say: My IP is   192.168.23.88   and I can stream music, save your backups, and act as a fileserver. If it is not what you want to hear on your network you can stop / disable the avahi daemon with the standard  systemctl  command, but if you run a cups-broadcast daemon, it will start the avahi itself. Linux uses  fictive  users usually for security reasons, not to give the attacker any chance to hack a process owned by root. So you can see a  postfix  or  mail , and  postgres  or  mysql  users. The daemon, owned by such unprivileged user, gives...

How to add a user into Super user group in Linux

Found this article to be useful that worked just fine for me to add a user to a super user group.  https://www.howtogeek.com/842739/how-to-add-a-user-to-the-sudoers-file-in-linux/   enu Close Desktop Submenu Mobile Submenu Hardware Submenu Web Submenu Cutting Edge Submenu Lifestyle Submenu Reviews Buying Guides Deals Sign in Newsletter How to Add a User to the sudoers File in Linux Dave McKay Updated  Sep 1, 2023 Hannah Stryker / How-To Geek   Key Takeaways Adding a user to the sudoers file allows them to temporarily gain administrative powers on Linux and perform necessary actions. Logging in as the root user is inadvisable due to the potential for catastrophic mistakes and the ability to manipulate and remove other users. Use the "visudo" command to open and edit the sudoers file, granting specific permissions to users or groups for executing commands with sudo. If a  sudo  command on Linux gets you a message that a user "is not in the sudoers file," you'...