Solved

Sudo question

Posted on 2003-12-04
7
326 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
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reset Root Password on CentOS 6 4 69
Choosing CentOS 16 107
How to retrieve remote exit code when using rsh from Linux to Windows ? 13 51
The better OS Architecture 13 64
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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…
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.

809 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