Super users in linux

Using Sudo for Super User Access to Root Privileges in Linux

The Linux super user, or root user, is a special user that has tremendous power, with the ability to access and modify all files on the operating system. This is necessary at times, but there is a potential for accidental errors to cause a great deal of destruction, so you have to be careful. (Like Spiderman says, with great power comes great responsibility.) Fot the times when the super user’s power is necessary, we’ll look at safer ways to be the super user on your Linux dedicated server.

Super User and Sudo

A really important feature of Linux is privileges. It’s part of the security, and controls which users can access, manipulate or even be aware of what files. Logged in with the user account we’ve created will allow safe usage of the operating system, but there are times when the privileges of the root, or super user are required.

There are two ways to access super user privileges. The first is with the su command.

If you enter this command, and note the hyphen, then you will be prompted for the root user’s password. Enter it correctly, and you will be logged in as the super user. You can then perform what tasks you need to, but with care! When you’ve finished, log out immediately using the exit command.

The second way to get super user privileges is to use sudo. This is a method by which a regular user can gain a temporary privilege boost. It takes a little setting up, but once done it is probably safer than the su command method.

First, log in to your server. Then, log in as root using the su command. Then, enter the following.

This will open up a text file that contains information for sudo. A little way down the file you’ll see the following text.

# User privilege specification

You need to add yourself to the file in order to get your privileges. To do this, you need to do a little editing. Use the arrow keys to move the cursor to this line, then press i on the keyboard. You’re now editing the file, so enter the following line:

Of course substitute your user name for YourUserName, then press escape, and type ZZ (capital Z twice). This will save the file, and that’s it. If you’ve done it right, you can now use sudo. To test this, log out as the root user (type exit, hit return), then try the following.

Читайте также:  Kali linux ssh root

You should receive an error message telling you that permission is denied. So, try it with sudo.

Now you will be asked for a password. Enter your own password at this point (not the root password) and hey presto, you’ll be presented with a listing of the root user’s directory. So, any time that you wish to do something that requires root user privileges, remember that you can use the sudo command, saving you from logging in as the root user.

Logging out

To log out of your ssh session, and so your server, at any time, type:

If you are logged in as the super user having used the su command, remember that you may need to type this twice.

Now we know how to log in and out we want to do something constructive with the server, but before we get to the commands we should take a look at the Linux directory structure.

  • Advantage to Shared Web Hosting
  • Shared Hosting Issues – Shared Bandwidth and Server Resources
  • The Ins and Outs of Dedicated Web Hosting
  • When To Move To A Dedicated Server
  • Choosing a Dedicated Server for your Website
  • Managing and Operating a Dedicated Server Over the Internet Using Online Control Panels
  • Accessing the Linux Operating System on Dedicated Servers with PuTTY or SSH
  • How to Create a Secure Password
  • Using Sudo for Super User Access to Root Privileges in Linux
  • The Linux Directory Structure
  • Linux Commands for Navigating and Viewing Directories
  • Creating, Moving, Renaming and Copying Files and Directories in Linux
  • Find, View and Delete Files and Directories Using Linux Commands
  • Using vi to Edit Text Files on A Linux Dedicated Server

Latest Articles

How To Kill A Running Process

How To Kill A Running Process Method #1: There are many ways to kill an active process, and in this article we will examine some of the most common and effective approaches to achieve this task. When deciding to end a process, especially during a time when your system is compromised with a … [Read More. ]

Where to Learn More about Web Design and Website Development

If you’re looking for a book on web page building, look for one that matches the tools and technologies that you’re going to be using. Tools include: HTML editors (eg FrontPage or Dreamweaver) Graphics editing software Database software Technologies include things … [Read More. ]

CD-ROM The Disc

The basic CD-ROM (Compact Disc — Read Only Memory) is 120mm in diameter and is basically a 1.2mm sandwich of three coatings: a back layer of clear polycarbonate plastic, a thin sheet of aluminium and a lacquer coating to protect the disc … [Read More. ]

Comments

a question about
sudo su
does this command enable root without asking for the account password ?
therefore is it safer to enable root just to set a password so that if someone who knows your account password cannot perform sudo commands ?
or …if the ‘sudo su’ command doesnt ask for a password does it even make a difference ?

Читайте также:  Добавить путь переменную path linux

What You Need to Know About Automation with Chrome

Automation is drastically changing the way we interact with the Internet. One survey found that 76% of businesses use automation to streamline … [Read More. ]

9 Steps to Take When Building a Web Scraper in Python

Web scraping is a method for collecting, organizing and analyzing information that is spread over the Internet in a disorganized way. It can … [Read More. ]

8 Steps To Streamline Your Business Operations with Virtual Data Rooms

With the increased reliance on networking and cloud computing, businesses generate and store an ever-increasing amount of sensitive information. As a … [Read More. ]

Advantages and disadvantages of using Perl in web programming

Web pages are designed using programming codes and a number of technologies as tools to achieve the desired objectives. An example of the above … [Read More. ]

Why Cross-Chain Trading Is the Future of Crypto Investing?

The rapid growth and evolution of the cryptocurrency market have opened up exciting opportunities for investors. Within this dynamic landscape, … [Read More. ]

Downsides of Using AI Art Cannot Be Overlooked

AI is changing the way designers and artists create their work. Artificial Intelligence makes it possible to create images faster, more accurately and … [Read More. ]

Источник

e Learning

On a Linux system Superuser refer to the root user, who has unlimited access to the file system with privilege to run all Linux commands.

Regular Linux user can only access files owned by the user himself. same way regular users cannot execute commands that have an effect to the hole Linux system. So most of the time you will have to become Superuser if you want to perform administrative tasks.

There are two methods we can use to get superuser access in Linux.

Becoming root using the su command

Linux su command allows regular users to log in as root using the root password. Just logged in to a regular user account and type following command on the terminal.

You will be prompted to type root password. Once you entered the correct password, you will be redirected to the root shell which has superuser access and maximum privileges to the file Linux system. Type exit, or press CTRL+D on keyboard to logout from the root shell.

Becoming Superuser using Linux sudo command

Some Linux distributions like Ubuntu, RHEL 7 and CentOS 7 allows regular users to get superuser access by using their own password by using the sudo command.

This time you will be prompt your own password, not the root password.

Not all users can use the sudo command. In CentOS 7 only the member of the wheel group can execute commands with sudo. In Ubuntu Linux member of the either sudo group or admin group able to run the sudo command.

Источник

Как стать суперпользователем в Linux

В создании этой статьи участвовала наша опытная команда редакторов и исследователей, которые проверили ее на точность и полноту.

Команда контент-менеджеров wikiHow тщательно следит за работой редакторов, чтобы гарантировать соответствие каждой статьи нашим высоким стандартам качества.

Количество просмотров этой статьи: 105 805.

Учетная запись суперпользователя в Linux предоставляет полный доступ к системе. Права суперпользователя (администратора) необходимы для выполнения команд в Linux, особенно тех команд, которые затрагивают системные файлы. Так как аккаунт суперпользователя имеет неограниченный доступ к системным файлам, рекомендуется получать права суперпользователя только при необходимости, а не входить в систему в качестве администратора. Это поможет предотвратить случайное повреждение важных системных файлов.

Читайте также:  Linux smb mount fstab

Получение прав суперпользователя через терминал

Изображение с названием Become Root in Linux Step 1

Изображение с названием Become Root in Linux Step 2

Введите . su — и нажмите ↵ Enter . С помощью этой команды можно войти в систему в качестве суперпользователя. Используйте указанную команду для входа в систему в качестве любого пользователя, но если команда не содержит имени пользователя, вы войдете в систему как администратор. [1] X Источник информации

Изображение с названием Become Root in Linux Step 3

  • Если появилось сообщение об ошибке аутентификации (authentication error), скорее всего, учетная запись суперпользователя заблокирована. Чтобы узнать, как разблокировать аккаунт, прочитайте следующий раздел.

Изображение с названием Become Root in Linux Step 4

Обратите внимание на приглашение на ввод команды (в окне терминала). Если вы получили права суперпользователя, в конце приглашения на ввод команды вместо значка $ появится значок # . [2] X Источник информации

Изображение с названием Become Root in Linux Step 5

Введите команды, на исполнение которых нужны права суперпользователя. После входа в систему с помощью команды su — и получения прав суперпользователя можно запускать любые команды, которые требуют административного доступа. Активность команды su — сохраняется до конца сессии, поэтому пароль суперпользователя не нужно вводить каждый раз, когда необходимо выполнить очередную команду.

Изображение с названием Become Root in Linux Step 6

  • Введите sudo команда и нажмите ↵ Enter (например, sudo ifconfig ). Введите свой пароль пользователя, а не пароль суперпользователя.
  • Команду sudo рекомендуется использовать в некоторых дистрибутивах Linux, например, в Ubuntu, потому что она работает даже тогда, когда учетная запись суперпользователя заблокирована.
  • Эта команда доступна пользователям с правами администратора. Добавить или удалить пользователя можно в /etc/sudoers .

Источник

Who is superuser in linux?

On a Linux system Superuser refer to the root user, who has unlimited access to the file system with privilege to run all Linux commands. Regular Linux user can only access files owned by the user himself. same way regular users cannot execute commands that have an effect to the hole Linux system.

Who owns superuser account?

In Windows systems, the Administrator account holds superuser privileges. Each Windows computer has at least one administrator account. The Administrator account allows the user to install software, and change local configurations and settings, and more.

Is a super user in Linux?

Sudo (superuser do) is a utility for UNIX- and Linux-based systems that provides an efficient way to give specific users permission to use specific system commands at the root (most powerful) level of the system. Sudo also logs all commands and arguments.

Where is super user in Linux?

You need to use any one of the following command to log in as superuser / root user on Linux: su command – Run a command with substitute user and group ID in Linux. sudo command – Execute a command as another user on Linux.

How do I become a Linux superuser?

  1. Method 1: Use ‘sudo -i’ to become root user or superuser in Linux.
  2. Method 2: Use ‘sudo -s’ to become root user or superuser in Linux.
  3. Method 3: Use ‘sudo su -‘ to become root user or superuser in Linux.
  4. Method 4: Use ‘su — root’ to become root user or superuser in Linux.

Источник

Оцените статью
Adblock
detector