Solved

Sudo question

Posted on 2003-12-04
7
327 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cannot rename datastore 3 94
bash file 10 63
Migrating php-mysql-jquery application to Microsoft Azure Cloud 7 49
Apache module 5 61
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

735 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