Solved

Sudo question

Posted on 2003-12-04
7
329 Views
Last Modified: 2010-04-21
How do I use sudo with the -S option to input the password via stdin? Can someone give me an example?
0
Comment
Question by:rsumilang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 9880798
try something like this
    sudo -S cat /logs/*.log


hongjun
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9880868
for simple passwd command it works like this.

passwd --stdin username < filename

Place the new password in the file. The new password will not be checked.
0
 

Author Comment

by:rsumilang
ID: 9880884
I got it working with... echo "password" | sudo -S <command>

Thanks for the help anyways
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:shivsa
ID: 9880943
sudo -S -u username < filename
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10328688
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Split between rsumilang and shivsa
Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

khkremer
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10361824
PAQed, with points refunded (250)

Computer101
E-E Admin
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question