Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu.Wang 2018-11-27 21:27:12 +08:00
commit 2f4070317b
7 changed files with 1187 additions and 0 deletions

View File

@ -0,0 +1,75 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (DevOps is for everyone)
[#]: via: (https://opensource.com/article/18/11/how-non-engineer-got-devops)
[#]: author: (Dawn Parych https://opensource.com/users/dawnparzych)
[#]: url: ( )
DevOps is for everyone
======
A non-engineer explains why you don't need to be a developer or an operations person to fall for DevOps.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1)
I've never held a job as a developer nor in operations—so what am I doing writing an article about [DevOps][1]? I've always been interested in computers and technology. I also have a passion for people, psychology, and helping others. When I first heard about DevOps, the concept piqued my interest, as it seemed to merge many of the things I was interested in, even if I don't write code.
My first computer was a TRS-80, and I loved writing BASIC programs on it. I took the only two computer programming classes my high school offered. A few years later, I started a computer company. I made custom mailing labels, stationery, and built a database to store addresses.
The problem was I didn't enjoy writing code. I wanted to teach and to help people, and I didn't see writing code as an opportunity to do this. Yes, technology can help people and change lives, but writing code didn't spark my passion. I need to feel excited about my work and do something I love.
* The culture, not the code
* The journey, not the result
* Building an environment where everybody can continuously improve
* Communicating and collaborating, not working independently
I found that I love DevOps. To me, DevOps is about:
Ultimately, DevOps is about being part of a community working towards the same goal. DevOps merges psychology, people, and technology. DevOps isn't a job title; it is a philosophy for life and work.
### Finding my people
Almost four years ago, I attended my first [DevOpsDays][2] conference in Seattle. I felt like I had found my people. I felt welcomed and accepted, even though I work in marketing and don't have a computer science degree. I could geek out over psychology and technology.
At DevOpsDays, I learned about the ["Three Ways" of DevOps][3]—flow, feedback, and continuous experimentation and learning—and new (to me) concepts such as Kaizen and Kaikaku. As I learned, I found myself saying things like, "I do this! I didn't know there was a name for this!"
[Kaizen][4] is the practice of continuous improvement and learning. Small, incremental changes over time can yield significant results. I found parallels between this and Carol Dweck's idea of a [growth mindset][5]. People aren't born experts. Becoming skilled at something takes time, practice, and often failure. Recognizing incremental improvement is necessary to make sure we don't give up.
[Kaikaku][6], on the other hand, is the notion that small changes over time sometimes won't work, and you need to make a radical or disruptive change. Quitting a job without having a new one lined up or moving to a new city can be pretty disruptive—yes, I've done both. But these radical changes can reap great rewards. I might not have learned about DevOps if I hadn't quit my job and taken some time off. Once I decided to return to work, I kept hearing about DevOps and started researching it. This led me to attend my first DevOpsDays, where I began to see all my passions come together. Since then, I have presented at five DevOpsDays and regularly write about DevOps topics.
### Putting the Three Ways to work
Change is hard and learning something new can be scary. The Three Ways of DevOps provide a framework for managing change. For example: How is information flowing? What is driving you to make a change? Once you know a change is needed, how do you get feedback about whether the changes you are making are the right changes? How do you know if you're making progress? Feedback is essential and should include both positive and constructive elements. The hard part is making sure the constructive elements don't outweigh the positive.
For me, the third Way—continuous experimentation and learning—is the most important part of DevOps. Having an environment where people are free to experiment and take risks can lead to unexpected outcomes. Sometimes those outcomes are good, sometimes not so good—and that's OK. Creating an environment where it is acceptable if things don't work out encourages people to take risks. We should all strive to continuously experiment and learn something new on a regular basis.
The Three Ways of DevOps provides a method of trying something, getting feedback, and learning from our mistakes. A few years ago, my son told me, "I don't ever want to be the best at something, because then I can't learn from my mistakes." We all make mistakes, and learning from them helps us grow and improve. We aren't willing to make mistakes if our culture doesn't support experimentation and learning.
### Being part of the community
I've worked in technology for over 20 years and often felt like an outsider until I found the DevOps community. If you're like me—passionate about technology but not the engineering or operations side of things—you can still be a part of DevOps, even if you work in sales, marketing, product marketing, technical writing, support, and more. DevOps is for everyone.
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/11/how-non-engineer-got-devops
作者:[Dawn Parych][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/dawnparzych
[b]: https://github.com/lujun9972
[1]: https://opensource.com/resources/devops
[2]: https://www.devopsdays.org/
[3]: https://itrevolution.com/the-three-ways-principles-underpinning-devops/
[4]: https://en.wikipedia.org/wiki/Kaizen
[5]: https://en.wikipedia.org/wiki/Mindset#Fixed_and_growth
[6]: https://en.wikipedia.org/wiki/Kaikaku

View File

@ -0,0 +1,72 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (How to use multiple programming languages without losing your mind)
[#]: via: (https://opensource.com/article/18/11/multiple-programming-languages)
[#]: author: (Bart Copeland https://opensource.com/users/bartcopeland)
[#]: url: ( )
How to use multiple programming languages without losing your mind
======
A polyglot environment is a double-edged sword, bringing benefits along with complexities that may threaten the organization.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2)
With all the different programming languages available today, many organizations have become digital polyglots. Open source opens up a world of languages and technology stacks developers can use to accomplish their tasks, including developing and supporting legacy and modern software applications.
Polyglots can talk with millions more people than those who only speak their native language. In software environments, developers don't introduce new languages to achieve specifc ends, not to communicate better. Some languages are great for one task but not another, so working with multiple programming languages enables developers to use the right tool for the job. In this way, all development is polyglot; it's just the nature of the beast.
The creation of a polyglot environment is often gradual and situational. For example, when an enterprise acquires a company, it takes on the company's technology stacks—including its programming languages. Or as tech leadership changes, new leaders may bring different technologies into the fold. Technologies also fall in and out of fashion, expanding the number of programming languages and technologies an organization has to maintain over time.
A polyglot environment is a double-edged sword for enterprises, bringing benefits but also complexities and challenges. Ultimately, if the situation remains unchecked, polyglot will kill your enterprise.
### Tricky technical tongue-twisters
Where there are multiple different technologies—programming languages, legacy tools, and up-and-coming technology stacks—there is complexity. Engineering teams spend more time wrestling to retrofit programming languages with licenses, security, and dependencies. At the same time, management lacks oversight on code compliance and can't gauge risk.
What happens is that enterprises have varying degrees of programming language quality and high variability in tooling support. It's hard to become an expert in one language when you're required to work with a dozen. There's a big difference in skill level between a person who speaks French and Italian fluently and a person who can string a few sentences together in eight languages. The same is true for developers and programming languages.
The difficulties only increase with the addition of more programming languages, leading to a digital Tower of Babel.
The answer is not to take away the tools your developers need for the job. Adding new programming languages builds their skill base and empowers them with the right equipment to fulfill their craft. So, you want to say "yes" to your developers, but as more and more programming languages are added to the enterprise, they impose a drag on your software development lifecycle (SDLC). At scale, all these languages and tools can kill the enterprise.
There are three main issues enterprises should pay attention to:
1. **Visibility:** Teams come together for a project, then disband. Applications are released and never updated—why fix what's not broken? As a result, when a critical vulnerability is discovered, the enterprise may not have visibility into which applications are affected, which libraries those applications contain, or even what languages they were built with. This can result in costly "exploration projects" to ensure the vulnerability is properly addressed.
2. **Updating or coding:** Some enterprises centralize the updating and fixing function in a single team. Others require that each "pizza team" manage its own development tools. In either case, the engineering team and management pay an opportunity cost: rather than coding new features, these teams are constantly updating and fixing libraries in their open source tools since they move so quickly.
3. **Reinventing the wheel:** Since code dependencies and library versions are constantly being updated, the artifacts associated with the original build of an application may no longer be available when a vulnerability is found. As a result, many development cycles are wasted trying to recreate an environment in which the vulnerability can be fixed.
Multiply each programming language in your organization by these three issues, and what started out as a molehill suddenly looks like Mount Everest. And just like a mountain climber, you won't survive without the proper equipment and tools.
### Finding your Rosetta Stone
A comprehensive solution that serves the needs of the enterprise and its individual stakeholders in the SDLC is in order. Enterprises can create this solution using these best practices:
1. Monitor code running in production and respond based on risk of flagged components (e.g., common vulnerabilities and exposures components) used in your applications.
2. Receive regular updates to keep code current and bug-free.
3. Use commercial open source support to get help with programming language versions and platforms that are near end-of-life and not supported by the community.
4. Standardize specific programming language builds across your enterprise to enable consistent environments across teams and minimize dependencies.
5. Set thresholds for when to trigger an update, alarm, or another kind of event based on dependencies.
6. Create a single source of truth for your package management; this may require the assistance of a knowledgeable technology provider.
7. Get smaller build distributions with only the packages you need, based on your specific criteria.
Using these best practices, developers can maximize their time to create more value for the enterprise instead of doing basic tooling or build-engineering tasks. This will create code consistency in all environments in the software development life cycle (SDLC). It will also create greater efficiency and cost savings as fewer resources are needed to maintain programming languages and package distributions. This new way of operating will make the lives of both technical staff and management easier.
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/11/multiple-programming-languages
作者:[Bart Copeland][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/bartcopeland
[b]: https://github.com/lujun9972

View File

@ -0,0 +1,214 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (Arch-Wiki-Man A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline)
[#]: via: (https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/)
[#]: author: ([Prakash Subramanian](https://www.2daygeek.com/author/prakash/))
[#]: url: ( )
Arch-Wiki-Man A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline
======
Getting internet is not a big deal now a days, however there will be a limitation on technology.
I was really surprise to see the technology growth but in the same time there will be fall in everywhere.
Whenever you search anything about other Linux distributions most of the time you will get a third party links in the first place but for Arch Linux every time you would get the Arch Wiki page for your results.
As Arch Wiki has most of the solution other than third party websites.
As of now, you might used web browser to get a solution for your Arch Linux system but you no need to do the same for now.
There is a solution is available in command line to perform this action much faster way and the utility called arch-wiki-man. If you are Arch Linux lover, i would suggest you to read **[Arch Linux Post Installation guide][1]** which helps you to tweak your system for day to day use.
### What is arch-wiki-man?
[arch-wiki-man][2] tool allows user to search the arch wiki pages right from the command line (CLI) instantly without internet connection. It allows user to access and search an entire wiki pages as a Linux man page.
Also, you no need to switch to GUI. Updates are pushed automatically every two days so, your local copy of the Arch Wiki pages will be upto date. The tool name is `awman`. awman stands for Arch Wiki Man.
We had already wrote similar kind of topic called **[Arch Wiki Command Line Utility][3]** (arch-wiki-cli) which allows user search Arch Wiki from command line but make sure you should have internet to use this utility.
### How to Install arch-wiki-man tool?
arch-wiki-man utility is available in AUR repository so, we need to use AUR helper to install it. There are many AUR helper is available and we had wrote an article about **[Yaourt AUR helper][4]** and **[Packer AUR helper][5]** which are very famous AUR helper.
```
$ yaourt -S arch-wiki-man
or
$ packer -S arch-wiki-man
```
Alternatively we can install it using npm package manager. Make sure, you should have installed **[NodeJS][6]** on your system. If so, run the following command to install it.
```
$ npm install -g arch-wiki-man
```
### How to Update the local Arch Wiki copy?
As updated previously, updates are pushed automatically every two days and it can be done by running the following command.
```
$ sudo awman-update
[sudo] password for daygeek:
[email protected] /usr/lib/node_modules/arch-wiki-man
└── [email protected]
arch-wiki-md-repo has been successfully updated or reinstalled.
```
awman-update is faster and more convenient method to get the update. However, you can get the updates by reinstalling this package using the following command.
```
$ yaourt -S arch-wiki-man
or
$ packer -S arch-wiki-man
```
### How to Use Arch Wiki from command line?
Its very simple interface and easy to use. To search anything, just run `awman` followed by the search term. The general syntax is as follow.
```
$ awman Search-Term
```
### How to Search Multiple Matches?
If you would like to list all the results titles comes with `installation` string, run the following command format. If the output comes with multiple results then you will get a selection menu to navigate each item.
```
$ awman installation
```
![][8]
Detailed page screenshot.
![][9]
### Search a given string in Titles & Descriptions
The `-d` or `--desc-search` option allow users to search a given string in titles and descriptions.
```
$ awman -d mirrors
or
$ awman --desc-search mirrors
? Select an article: (Use arrow keys)
[1/3] Mirrors: Related articles
[2/3] DeveloperWiki-NewMirrors: Contents
[3/3] Powerpill: Powerpill is a pac
```
### Search a given string in Contents
The `-k` or `--apropos` option allow users to search a given string in content as well. Make a note, this option significantly slower your search as this scan entire wiki page content.
```
$ awman -k openjdk
or
$ awman --apropos openjdk
? Select an article: (Use arrow keys)
[1/26] Hadoop: Related articles
[2/26] XDG Base Directory support: Related articles
[3/26] Steam-Game-specific troubleshooting: See Steam/Troubleshooting first.
[4/26] Android: Related articles
[5/26] Elasticsearch: Elasticsearch is a search engine based on Lucene. It provides a distributed, mul..
[6/26] LibreOffice: Related articles
[7/26] Browser plugins: Related articles
(Move up and down to reveal more choices)
```
### Open the search results in a web browser
The `-w` or `--web` option allow users to open the search results in a web browser.
```
$ awman -w AUR helper
or
$ awman --web AUR helper
```
![][10]
### Search in other languages
The `-w` or `--web` option allow users to open the search results in a web browser. To see a list of supported language, run the following command.
```
$ awman --list-languages
arabic
bulgarian
catalan
chinesesim
chinesetrad
croatian
czech
danish
dutch
english
esperanto
finnish
greek
hebrew
hungarian
indonesian
italian
korean
lithuanian
norwegian
polish
portuguese
russian
serbian
slovak
spanish
swedish
thai
ukrainian
```
Run the awman command with your preferred language to see the results with different language other than English.
```
$ awman -l chinesesim deepin
```
![][11]
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/
作者:[Prakash Subramanian][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/prakash/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/arch-linux-post-installation-30-things-to-do-after-installing-arch-linux/
[2]: https://github.com/greg-js/arch-wiki-man
[3]: https://www.2daygeek.com/search-arch-wiki-website-command-line-terminal/
[4]: https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/
[5]: https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/
[6]: https://www.2daygeek.com/install-nodejs-on-ubuntu-centos-debian-fedora-mint-rhel-opensuse/
[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[8]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-1.png
[9]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-2.png
[10]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-3.png
[11]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-4.png

View File

@ -0,0 +1,176 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (Three SSH GUI Tools for Linux)
[#]: via: (https://www.linux.com/blog/learn/intro-to-linux/2018/11/three-ssh-guis-linux)
[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen)
[#]: url: ( )
Three SSH GUI Tools for Linux
======
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh.jpg?itok=3UcXhJt7)
At some point in your career as a Linux administrator, youre going to use Secure Shell (SSH) to remote into a Linux server or desktop. Chances are, you already have. In some instances, youll be SSHing into multiple Linux servers at once. In fact, Secure Shell might well be one of the most-used tools in your Linux toolbox. Because of this, youll want to make the experience as efficient as possible. For many admins, nothing is as efficient as the command line. However, there are users out there who do prefer a GUI tool, especially when working from a desktop machine to remote into and work on a server.
If you happen to prefer a good GUI tool, youll be happy to know there are a couple of outstanding graphical tools for SSH on Linux. Couple that with a unique terminal window that allows you to remote into multiple machines from the same window, and you have everything you need to work efficiently. Lets take a look at these three tools and find out if one (or more) of them is perfectly apt to meet your needs.
Ill be demonstrating these tools on [Elementary OS][1], but they are all available for most major distributions.
### PuTTY
Anyone thats been around long enough knows about [PuTTY][2]. In fact, PuTTY is the de facto standard tool for connecting, via SSH, to Linux servers from the Windows environment. But PuTTY isnt just for Windows. In fact, from withing the standard repositories, PuTTY can also be installed on Linux. PuTTYs feature list includes:
* Saved sessions.
* Connect via IP address or hostname.
* Define alternative SSH port.
* Connection type definition.
* Logging.
* Options for keyboard, bell, appearance, connection, and more.
* Local and remote tunnel configuration
* Proxy support
* X11 tunneling support
The PuTTY GUI is mostly a way to save SSH sessions, so its easier to manage all of those various Linux servers and desktops you need to constantly remote into and out of. Once youve connected, from PuTTY to the Linux server, you will have a terminal window in which to work. At this point, you may be asking yourself, why not just work from the terminal window? For some, the convenience of saving sessions does make PuTTY worth using.
Installing PuTTY on Linux is simple. For example, you could issue the command on a Debian-based distribution:
```
sudo apt-get install -y putty
```
Once installed, you can either run the PuTTY GUI from your desktop menu or issue the command putty. In the PuTTY Configuration window (Figure 1), type the hostname or IP address in the HostName (or IP address) section, configure the port (if not the default 22), select SSH from the connection type, and click Open.
![PuTTY Connection][4]
Figure 1: The PuTTY Connection Configuration Window.
[Used with permission][5]
Once the connection is made, youll then be prompted for the user credentials on the remote server (Figure 2).
![log in][7]
Figure 2: Logging into a remote server with PuTTY.
[Used with permission][5]
To save a session (so you dont have to always type the remote server information), fill out the IP address (or hostname), configure the port and connection type, and then (before you click Open), type a name for the connection in the top text area of the Saved Sessions section, and click Save. This will then save the configuration for the session. To then connect to a saved session, select it from the saved sessions window, click Load, and then click Open. You should then be prompted for the remote credentials on the remote server.
### EasySSH
Although [EasySSH][8] doesnt offer the amount of configuration options found in PuTTY, its (as the name implies) incredibly easy to use. One of the best features of EasySSH is that it offers a tabbed interface, so you can have multiple SSH connections open and quickly switch between them. Other EasySSH features include:
* Groups (so you can group tabs for an even more efficient experience).
* Username/password save.
* Appearance options.
* Local and remote tunnel support.
Install EasySSH on a Linux desktop is simple, as the app can be installed via flatpak (which does mean you must have Flatpak installed on your system). Once flatpak is installed, add EasySSH with the commands:
```
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak install flathub com.github.muriloventuroso.easyssh
```
Run EasySSH with the command:
```
flatpak run com.github.muriloventuroso.easyssh
```
The EasySSH app will open, where you can click the + button in the upper left corner. In the resulting window (Figure 3), configure your SSH connection as required.
![Adding a connection][10]
Figure 3: Adding a connection in EasySSH is simple.
[Used with permission][5]
Once youve added the connection, it will appear in the left navigation of the main window (Figure 4).
![EasySSH][12]
Figure 4: The EasySSH main window.
[Used with permission][5]
To connect to a remote server in EasySSH, select it from the left navigation and then click the Connect button (Figure 5).
![Connecting][14]
Figure 5: Connecting to a remote server with EasySSH.
[Used with permission][5]
The one caveat with EasySSH is that you must save the username and password in the connection configuration (otherwise the connection will fail). This means anyone with access to the desktop running EasySSH can remote into your servers without knowing the passwords. Because of this, you must always remember to lock your desktop screen any time you are away (and make sure to use a strong password). The last thing you want is to have a server vulnerable to unwanted logins.
### Terminator
Terminator is not actually an SSH GUI. Instead, Terminator functions as a single window that allows you to run multiple terminals (and even groups of terminals) at once. Effectively you can open Terminator, split the window vertical and horizontally (until you have all the terminals you want), and then connect to all of your remote Linux servers by way of the standard SSH command (Figure 6).
![Terminator][16]
Figure 6: Terminator split into three different windows, each connecting to a different Linux server.
[Used with permission][5]
To install Terminator, issue a command like:
### sudo apt-get install -y terminator
Once installed, open the tool either from your desktop menu or from the command terminator. With the window opened, you can right-click inside Terminator and select either Split Horizontally or Split Vertically. Continue splitting the terminal until you have exactly the number of terminals you need, and then start remoting into those servers.
The caveat to using Terminator is that it is not a standard SSH GUI tool, in that it wont save your sessions or give you quick access to those servers. In other words, you will always have to manually log into your remote Linux servers. However, being able to see your remote Secure Shell sessions side by side does make administering multiple remote machines quite a bit easier.
Few (But Worthwhile) Options
There arent a lot of SSH GUI tools available for Linux. Why? Because most administrators prefer to simply open a terminal window and use the standard command-line tools to remotely access their servers. However, if you have a need for a GUI tool, you have two solid options and one terminal that makes logging into multiple machines slightly easier. Although there are only a few options for those looking for an SSH GUI tool, those that are available are certainly worth your time. Give one of these a try and see for yourself.
--------------------------------------------------------------------------------
via: https://www.linux.com/blog/learn/intro-to-linux/2018/11/three-ssh-guis-linux
作者:[Jack Wallen][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linux.com/users/jlwallen
[b]: https://github.com/lujun9972
[1]: https://elementary.io/
[2]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
[3]: https://www.linux.com/files/images/sshguis1jpg
[4]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_1.jpg?itok=DiNTz_wO (PuTTY Connection)
[5]: https://www.linux.com/licenses/category/used-permission
[6]: https://www.linux.com/files/images/sshguis2jpg
[7]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_2.jpg?itok=4ORsJlz3 (log in)
[8]: https://github.com/muriloventuroso/easyssh
[9]: https://www.linux.com/files/images/sshguis3jpg
[10]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_3.jpg?itok=bHC2zlda (Adding a connection)
[11]: https://www.linux.com/files/images/sshguis4jpg
[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_4.jpg?itok=hhJzhRIg (EasySSH)
[13]: https://www.linux.com/files/images/sshguis5jpg
[14]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_5.jpg?itok=piFEFYTQ (Connecting)
[15]: https://www.linux.com/files/images/sshguis6jpg
[16]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_6.jpg?itok=-kYl6iSE (Terminator)

View File

@ -0,0 +1,335 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (14 Best ASCII Games for Linux That are Insanely Good)
[#]: via: (https://itsfoss.com/best-ascii-games/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
[#]: url: ( )
14 Best ASCII Games for Linux That are Insanely Good
======
Text-based or should I say [terminal-based games][1] were very popular a decade back when you didnt have visual masterpieces like God Of War, Red Dead Redemption 2 or Spiderman.
Of course, the Linux platform has its share of good games but not always the “latest and greatest”. But, there are some ASCII games out there to which you can never turn your back on.
Im not sure if youd believe me, some of the ASCII games proved to be very addictive (So, it might take a while for me to resume work on the next article, or I might just get fired? Help me!)
Jokes apart, let us take a look at the best ASCII games.
**Note:** Installing ASCII games could be time-consuming (some might ask you to install additional dependencies or simply wont work). You might even encounter some ASCII games that require you build from Source. So, weve filtered out only the ones that are easy to install/run without breaking a sweat.
### Things to do before Running or Installing an ASCII Game
Some of the ASCII games might require you to install [Simple DirectMedia Layer][2] unless you already have it installed. So, in case, you should install them first before trying to run any of the games mentioned in this article.
For that, you just need to type in these commands:
```
sudo apt install libsdl2-2.0
```
```
sudo apt install libsdl2_mixer-2.0
```
<https://www.youtube.com/embed/MGTHNw8c5pM?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
### Best ASCII Games for Linux
![Best Ascii games for Linux][3]
The games listed are in no particular order of ranking.
#### 1 . [Curse of War][4]
![Curse of War ascii games][5]
Curse of War is an interesting strategy game. You might find it a bit confusing at first but once you get to know it youll love it. Ill recommend you to take a look at the rules of the game on their [homepage][4] before launching the game.
You will be building infrastructure, secure resources and directing your army to fight. All you have to do is place your flag in a good position to let your army take care of the rest. Its not just about attacking you need to manage and secure the resources to help win the fight.
If youve never played any ASCII game before, be patient and spend some time learning it to experience it to its fullest potential.
##### How to install Curse of War?
You will find it in the official repository. So, type in the following command to install it:
```
sudo apt install curseofwar
```
#### 2. ASCII Sector
![ascii sector][6]
Hate strategy games? Fret not, ASCII sector is a game that has a space-setting and lets you explore a lot.
Also, the game isnt just limited to exploration, you need some action? You got that here as well. Of course, not the best combat experience- but it is fun. It gets even more exciting when you see a variety of bases, missions, and quests. Youll encounter a leveling system in this tiny game where you have to earn enough money or trade in order upgrade your spaceship.
The best part about this game is you can create your own quests or play others.
###### How to install ASCII Sector?
You need to first download and unpack the archived package from the [official site][7]. After its done, open up your terminal and type these commands (replace the **Downloads** folder with your location where the unpacked folder exists, ignore it if the unpacked folder resides inside your home directory):
```
cd Downloads
cd asciisec
chmod +x asciisec
./asciisec
```
#### 3. DoomRL
![doom ascii game][8]
You must be knowing the classic game “Doom”. So, if you want the scaled down experience of it as a rogue-like, DoomRL is for you. It is an ASCII-based game, in case you dont feel like it to be.
Its a very tiny game with a lot of gameplay hours to have fun with.
###### How to install DoomRL?
Similar to what you did for ASCII Sector, you need to download the official archive from their [download page][9] and then extract it to a folder.
After extracting it, type in these commands:
```
cd Downloads // navigating to the location where the unpacked folder exists
```
```
cd doomrl-linux-x64-0997
chmod +x doomrl
./doomrl
```
#### 4. Pyramid Builder
![Pyramid Builder ascii game for Linux][10]
Pyramid Builder is an innovative take as an ASCII game where get to improve your civilization by helping build pyramids.
You need to direct the workers to farm, unload the cargo, and move the gigantic stones to successfully build the pyramid.
It is indeed a beautiful ASCII game to download.
###### How to install Pyramid Builder?
Simply head to its official site and download the package to unpack it. After extraction, navigate to the folder and run the executable file.
```
cd Downloads
cd pyramid_builder_linux
chmod +x pyramid_builder_linux.x86_64
./pyramid_builder_linux.x86_64
```
#### 5. DiabloRL
![Diablo ascii RPG game][11]
If youre an avid gamer, you must have heard about Blizzards Diablo 1. It is undoubtedly a good game.
You get the chance to play a unique rendition of the game which is an ASCII game. DiabloRL is a turn-based rogue-like game that is insanely good. You get to choose from a variety of classes (Warrior, Sorcerer, or Rogue). Every class would result in a different gameplay experience with a set of different stats.
Of course, personal preference will differ but its a decent “unmake” of Diablo. What do you think?
#### 6. Ninvaders
![Ninvaders terminal game for Linux][12]
Ninvaders is one of the best ASCII game just because its so simple and an arcade game to kill time.
You have to defend against a hord of invaders just finish them off before they get to you. It sounds very simple but it is a challenging game.
##### How to install Ninvaders?
Similar to Curse of War, you can find this in the official repository. So, just type in this command to install it:
```
sudo apt install ninvaders 
```
#### 7. Empire
![Empire terminal game][13]
A real-time strategy game for which you will need an active Internet connection. Im personally not a fan of Real-Time strategy games, but if you are a fan of such games you should really check out their [guide][14] to play this game because it can be very challenging to learn.
The rectangle contains cities, land, and water. You need to expand your city with an army, ships, planes and other resources. By expanding quickly, you will be able to capture other cities by destroying them before they make a move.
##### How to install Empire?
Install this is very simple, just type in the following command:
```
sudo apt install empire
```
#### 8. Nudoku
![Nudoku is a terminal version game of Sudoku][15]
Love Sudoku? Well, you have Nudoku a clone for it. A perfect time-killing ASCII game while you relax.
It presents you with three difficulty levels Easy, normal, and hard. If you want to put up a challenge with the computer, the hard difficulty will be perfect! If you just want to chill, go for the easy one.
##### How to install Nudoku?
Its very easy to get it installed, just type in the following command in the terminal:
```
sudo apt install nudoku
```
#### 9\. Nethack
A dungeons and dragon-style ASCII game which is one of the best out there. I believe its one of your favorites if you already knew about ASCII games for Linux in general.
It features a lot of different levels (about 45) and comes packed in with a bunch of weapons, scrolls, potions, armor, rings, and gems. You can also choose permadeath as your mode to play it.
Its not just about killing here you got a lot to explore.
##### How to install Nethack?
Simply follow the command below to install it:
```
sudo apt install nethack
```
#### 10. ASCII Jump
![ascii jump game][16]
ASCII Jump is a dead simple game where you have to slide along a varierty of tracks while jumping, changing position, and moving as long as you can to cover maximum distance.
Its really amazing to see how this ASCII game looks like (visually) even it seems so simple. You can start with the training mode and then proceed to the world cup. You also get to choose your competitors and the hills on which you want to start the game.
##### How to install Ascii Jump?
To install the game, just type the following command:
```
sudo apt install asciijump
```
#### 11. Bastet
![Bastet is tetris game in ascii form][17]
Lets just not pay any attention to the name its actually a fun clone of Tetris game.
You shouldnt expect it to be just another ordinary tetris game but it will present you the worst possible bricks to play with. Have fun!
##### How to install Bastet?
Open the terminal and type in the following command:
```
sudo apt install bastet
```
#### 12\. Bombardier
![Bomabrdier game in ascii form][18]
Bombardier is yet another simple ASCII game which will keep you hooked on to it.
Here, you have a helicopter (or whatever youd like to call your aircraft) which lowers down every cycle and you need to throw bombs in order to destroy the blocks/buildings under you. The game also puts a pinch of humor for the messages it displays when you destroy a block. It is fun.
##### How to install Bombardier?
Bombardier is available in the official repository, so just type in the following in the terminal to install it:
```
sudo apt install bombardier
```
#### 13\. Angband
![Angband ascii game][19]
A cool dungeon exploration game with a neat interface. You can see all the vital information in a single screen while you explore the game.
It contains different kinds of race to pick a character. You can either be an Elf, Hobbit, Dwarf or something else theres nearly a dozen to choose from. Remember, that you need to defeat the lord of darkness at the end so make every upgrade possible to your weapon and get ready.
How to install Angband?
Simply type in the following command:
```
sudo apt install angband
```
#### 14\. GNU Chess
![GNU Chess is a chess game that you can play in Linux terminal][20]
How can you not play chess? It is my favorite strategy game!
But, GNU Chess can be tough to play with unless you know the Algebraic notation to describe the next move. Of course, being an ASCII game it isnt quite possible to interact so it asks you the notation to detect your move and displays the output (while it waits for the computer to think its next move).
##### How to install GNU Chess?
If youre aware of the algebraic notations of Chess, enter the following command to install it from the terminal:
```
sudo apt install gnuchess
```
#### Some Honorable Mentions
As I mentioned earlier, weve tried to recommend you the best (but also the ones that are the easiest to install on your Linux machine).
However, there are some iconic ASCII games which deserve the attention and requires a tad more effort to install (You will get the source code and you need to build it / install it).
Some of those games are:
+ [Cataclysm: Dark Days Ahead][22]
+ [Brogue][23]
+ [Dwarf Fortress][24]
You should follow our [guide to install software from source code][21].
### Wrapping Up
Which of the ASCII games mentioned seem perfect for you? Did we miss any of your favorites?
Let us know your thoughts in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/best-ascii-games/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/best-command-line-games-linux/
[2]: https://www.libsdl.org/
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/best-ascii-games-featured.png?resize=800%2C450&ssl=1
[4]: http://a-nikolaev.github.io/curseofwar/
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/curseofwar-ascii-game.jpg?fit=800%2C479&ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/ascii-sector-game.jpg?fit=800%2C424&ssl=1
[7]: http://www.asciisector.net/download/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/doom-rl-ascii-game.jpg?ssl=1
[9]: https://drl.chaosforge.org/downloads
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/pyramid-builder-ascii-game.jpg?fit=800%2C509&ssl=1
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/diablo-rl-ascii-game.jpg?ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/ninvaders-ascii-game.jpg?fit=800%2C426&ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/empire-ascii-game.jpg?fit=800%2C570&ssl=1
[14]: http://www.wolfpackempire.com/infopages/Guide.html
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/nudoku-ascii-game.jpg?fit=800%2C434&ssl=1
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/ascii-jump.jpg?fit=800%2C566&ssl=1
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/bastet-tetris-clone-ascii.jpg?fit=800%2C465&ssl=1
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/bombardier.jpg?fit=800%2C571&ssl=1
[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/angband-ascii-game.jpg?ssl=1
[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/gnuchess-ascii-game.jpg?ssl=1
[21]: https://itsfoss.com/install-software-from-source-code/
[22]: https://github.com/CleverRaven/Cataclysm-DDA
[23]: https://sites.google.com/site/broguegame/
[24]: http://www.bay12games.com/dwarves/index.html

View File

@ -0,0 +1,142 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (How To Configure IP Address In Ubuntu 18.04 LTS)
[#]: via: (https://www.ostechnix.com/how-to-configure-ip-address-in-ubuntu-18-04-lts/)
[#]: author: (SK https://www.ostechnix.com/author/sk/)
[#]: url: ( )
How To Configure IP Address In Ubuntu 18.04 LTS
======
![](https://www.ostechnix.com/wp-content/uploads/2018/11/configure-ip-address-720x340.jpg)
The method of configuring IP address on Ubuntu 18.04 LTS is significantly different than the older methods. Unlike the previous versions, the Ubuntu 18.04 uses **Netplan** , a new command line network configuration utility, to configure IP address. Netplan has been introduced by Ubuntu developers in Ubuntu 17.10. In this new approach, we no longer use **/etc/network/interfaces** file to configure IP address rather we use a YAML file. The default configuration files of Netplan are found under **/etc/netplan/** directory. In this brief tutorial, we are going to learn to configure static and dynamic IP address in **Ubuntu 18.04 LTS** minimal server.
### Configure Static IP Address In Ubuntu 18.04 LTS
Let us find out the default network configuration file:
```
$ ls /etc/netplan/
50-cloud-init.yaml
```
As you can see, the default network configuration file is **50-cloud-init.yaml** and it is obviously a YAML file.
Now, let check the contents of this file:
```
$ cat /etc/netplan/50-cloud-init.yaml
```
I have configured my network card to obtain IP address from the DHCP server when I am installing Ubuntu 18.04, so here is my network configuration details:
![](https://www.ostechnix.com/wp-content/uploads/2018/11/configure-network.png)
As you can see, I have two network cards, namely **enp0s3** and **enp0s8** , and both are configured to accept IPs from the DHCP server.
Let us now configure static IP addresses to both network cards.
To do so, open the default network configuration file in any editor of your choice.
```
$ sudo nano /etc/netplan/50-cloud-init.yaml
```
Now, update the file by adding the IP address, netmask, gateway and DNS server. For the purpose of this file, I have used **192.168.225.50** as my IP for **enp0s3** and **192.168.225.51** for **enp0s8** , **192.168.225.1** as gateway, **255.255.255.0** as netwmask and **8.8.8.8** , **8.8.4.4** as DNS servers.
![](https://www.ostechnix.com/wp-content/uploads/2018/11/configure-static-ip.png)
Please mind the space between the lines. Dont use **TAB** to align the lines as it will not work in Ubuntu 18.04. Instead, just use SPACEBAR key to make them in a consistent order as shown in the above picture.
Also, we dont use a separate line to define netmask (255.255.255.0) in Ubuntu 18.04. For instance, in older Ubuntu versions, we configure IP and netmask like below:
```
address = 192.168.225.50
netmask = 255.255.255.0
```
However, with netplan, we combine those two lines with a single line as shown below:
```
addresses : [192.168.225.50/24]
```
Once youre done, Save and close the file.
Apply the network configuration using command:
```
$ sudo netplan apply
```
If there are any issues, run the following command to investigate and check what is the problem in the configuration.
```
$ sudo netplan --debug apply
```
Output:
```
** (generate:1556): DEBUG: 09:14:47.220: Processing input file //etc/netplan/50-cloud-init.yaml..
** (generate:1556): DEBUG: 09:14:47.221: starting new processing pass
** (generate:1556): DEBUG: 09:14:47.221: enp0s8: setting default backend to 1
** (generate:1556): DEBUG: 09:14:47.222: enp0s3: setting default backend to 1
** (generate:1556): DEBUG: 09:14:47.222: Generating output files..
** (generate:1556): DEBUG: 09:14:47.223: NetworkManager: definition enp0s8 is not for us (backend 1)
** (generate:1556): DEBUG: 09:14:47.223: NetworkManager: definition enp0s3 is not for us (backend 1)
DEBUG:netplan generated networkd configuration exists, restarting networkd
DEBUG:no netplan generated NM configuration exists
DEBUG:device enp0s3 operstate is up, not replugging
DEBUG:netplan triggering .link rules for enp0s3
DEBUG:device lo operstate is unknown, not replugging
DEBUG:netplan triggering .link rules for lo
DEBUG:device enp0s8 operstate is up, not replugging
DEBUG:netplan triggering .link rules for enp0s8
```
Now, let us check the Ip address using command:
```
$ ip addr
```
Sample output from my Ubuntu 18.04 LTS:
![](https://www.ostechnix.com/wp-content/uploads/2018/11/Check-IP-address.png)
Congratulations! We have successfully configured static IP address in Ubuntu 18.04 LTS with Netplan configuration tool.
For more details, refer the Netplan man pages.
```
$ man netplan
```
### Configure Dynamic IP Address In Ubuntu 18.04 LTS
To configure dynamic address, just leave the default configuration file as the way it is. If you already have configured static IP address, just remove the newly added lines and make the YAML file look like exactly as shown in the **figure 1** in the previous section.
Thats all. You know now how to configure static and dynamic IP in Ubuntu 18.04 LTS server. Personally, I dont like this new method. The old method is much easier and better. How about you? Did you find it easy or hard? Let me know in the comment section below.
More good stuffs to come. Stay tuned!
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/how-to-configure-ip-address-in-ubuntu-18-04-lts/
作者:[SK][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972

View File

@ -0,0 +1,173 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (How to use the sudo command to deploy superuser powers on Linux)
[#]: via: (https://www.networkworld.com/article/3322504/linux/selectively-deploying-your-superpowers-on-linux.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
[#]: url: ( )
How to use the sudo command to deploy superuser powers on Linux
======
![](https://images.idgesg.net/images/article/2018/11/superman-100781085-large.jpg)
The **sudo** command is very handy when you need to run occasional commands with superuser power, but you can sometimes run into problems when it doesnt do everything you expect it should. Say you want to add an important message at the end of some log file and you try something like this:
```
$ echo "Important note" >> /var/log/somelog
-bash: /var/log/somelog: Permission denied
```
OK, it looks like you need to employ some extra privilege. In general, you can't write to a system log file with your user account. Lets try that again with **sudo**.
```
$ sudo !!
sudo echo "Important note" >> /var/log/somelog
-bash: /var/log/somelog: Permission denied
```
Hmm, that didn't work either. Let's try something a little different.
```
$ sudo 'echo "Important note" >> /var/log/somelog'
sudo: echo "Important note" >> /var/log/somelog: command not found
```
**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][1] ]**
### What's going on here?
The response to the first of the commands shown above indicates that you lack the required privilege to write to the log file. In the second, you have simply tried to run the previously entered command with root privilege, but that resulted in a **Permission denied** error. In the third, you've tried to rerun the command by putting the entire command in quotes and ran into a **command not found** error. So, what went wrong?
* First command: You cant write to that log without root privilege.
* Second command: Your superpowers don't extend to the redirect.
* Third command: Sudo doesnt recognize everything youve put into the quotes as a "command."
And if you had tried to use sudo when you had no sudo access at all, you would have seen an error like this:
```
nemo is not in the sudoers file. This incident will be reported.
```
### What can you do?
One fairly simple option is to use the sudo command to briefly become root. Given you have sudo privileges, you might be able to do that with a command like this one:
```
$ sudo su
[sudo] password for nemo:
#
```
Notice that the prompt has changed to indicate your new authority. Then you can run the original command as root:
```
# echo "Important note" >> /var/log/somelog
```
And then you can enter **^d** and go back to being yourself. Of course, some sudo configurations might prevent you from using sudo to become root.
Another option is to switch user to root with just the **su** command, but that requires knowing the root password. Many people will be given access to sudo without being provided with the root password, so this won't always work.
If you switch user to root, you can then run commands as root to your hearts content. The problems with this approach are 1) everyone exercising root privilege will have to know the root password (not very secure) and 2) you won't be protected from the repercussions of making big mistakes if you fail to exit your privileged status after you run the specific commands that require root privilege. The sudo command is intended to allow you to use root privilege _only_ when you really need it and to control how much of roots power each sudo user ought to have. Its also intended to easily revert to having you working in your normal user state.
Note also that this entire discussion is predicated on the assumption that you have access to sudo and that your access is not narrowly defined. More on that in a moment.
Another option is to use a different command. If adding to a file by editing it is an option, you might use a command such as "sudo vi /var/log/somelog", though editing an active log file isn't generally a good idea because of how frequently the system might need to write to it.
A final but more complex option is to use one of the following commands that get around the problems we saw earlier, but they involve more complex syntax. The first command allows you to repeat your command using !! after getting the "Permission denied" rejection:
```
$ sudo echo "Important note" >> /var/log/somelog
-bash: /var/log/somelog: Permission denied
$ !!:gs/>/|sudo tee -a / <=====
$ tail -1 /var/log/somelog
Important note
```
The second allows you to add your message by passing your message to **tee** using the sudo command. Note that the **-a** specifies that the text should be appended to the file:
```
$ echo "Important note" | sudo tee -a /var/log/somelog
$ tail -1 /var/log/somelog
Important note
```
### How controllable is sudo?
The quick answer to this question is that it depends on the person administering it. Most Linux systems default to a very simple setup. If a user is assigned to a particular group, which might be called **wheel** or **admin** , that user will have the ability to run any command as root without having to know the root password. This is the default setup on most Linux systems. Once a user is added to the privileged group in the **/etc/group** file, that person can run any command with root privilege. On the other hand, sudo can be set up so that some users can only run a single command or any in a set of commands as root and nothing more.
If lines like those shown below were added to the **/etc/sudoers** file, for example, the user "nemo" would be allowed to run the **whoami** command with root authority. While this might not make any sense in the "real world," it works fairly well as an example.
```
# User alias specification
nemo ALL=(root) NOPASSWD: WHOAMI
# Cmnd alias specification
Cmnd_Alias WHOAMI = /usr/bin/whoami
```
Note that we've added both a command alias (Cmnd_Alias) that specifies the command that can be run — with their full paths — and a user alias that allows that user to run that single command with sudo without even entering a password.
When nemo runs the command **sudo whoami** , he will see this:
```
$ sudo whoami
root
```
Notice that, since nemo is running the command using sudo, the response to **whoami** shows that when the command is running, the user is **root**.
For other commands, nemo will see something like this:
```
$ sudo date
[sudo] password for nemo:
Sorry, user nemo is not allowed to execute '/bin/date' as root on butterfly.
```
### Default sudo setup
In the default approach, we'd be taking advantage of a line like one of those shown below from the **/etc/sudoers** file:
```
$ sudo egrep "admin|sudo" /etc/sudoers
# 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 <=====
```
In these lines, **%admin** and **%sudo** both refer to groups that permit anyone added to one of these groups to run any command as root using the sudo command.
A line like the one shown below from the /etc/group file makes the individuals listed members of the group, thereby giving them sudo privileges without any changes required in the /etc/sudoers file.
```
sudo:x:27:shs,nemo
```
### Wrap-up
The sudo command is meant to allow you to easily deploy superuser access on an as-needed basis, but also to endow users with very limited privileged access when that's all that is required. You can run into problems that require a different approach than a simple "sudo command," and the responses that you get from **sudo** should indicate what problem you've run into.
Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3322504/linux/selectively-deploying-your-superpowers-on-linux.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html
[2]: https://www.facebook.com/NetworkWorld/
[3]: https://www.linkedin.com/company/network-world