Sponsored Content
Top Forums Shell Programming and Scripting Question regarding for shell scripting. Post 303028481 by ulaxmi on Wednesday 9th of January 2019 07:38:05 AM
Old 01-09-2019
Question regarding for shell scripting.

I tried to run a command which simply generates SSH key with out prompting password.
After several trails , got the below command to run the script :

Code:
ssh-keygen -t rsa -N "" -f id_rsa
-N "" tells it to use an empty passphrase (the same as two of the enters in an interactive script)
-f id_rsa tells it to store the key into id_rsa.

The whole thing runs without you needing to supply any enter keys.

Moderator's Comments:
Mod Comment Please wrap up your samples in code tags.

Last edited by RavinderSingh13; 01-09-2019 at 08:58 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Scripting Question

To anyone who can help greetings, I am a beginner at Unix shell scripting and am taking a class. The assignment question is as follows: use a command-line tool named "itstat" which will display the resolution of an image file and some other lines of information. It accepts a list of image... (1 Reply)
Discussion started by: tech2040
1 Replies

2. Shell Programming and Scripting

Shell Scripting Question

To anyone who can help greetings, I am a beginner at Unix shell scripting. I need to know how to use the command line tool "itstat". I understand it's application, however I cannot find any additional information. Any assistance will be greatly appreciated. (3 Replies)
Discussion started by: tech2040
3 Replies

3. UNIX for Dummies Questions & Answers

shell scripting newbie question

Hi all! I'm a newbie to shell scripting. I want to create a script that will store a line from a text file in a variable so I can then use it to open firefox with that text in the address bar (the text file contains a list of addresses). I have tried the following: #!/bin/sh a='sed -n 2p... (2 Replies)
Discussion started by: jazzman
2 Replies

4. UNIX for Dummies Questions & Answers

Shell Scripting Question

Hi, I am assaigning the output to the variable outp and when i try to loop thru the variable i see the original content $OUTPUT also in the array outp. I dont want to have the original content in the array outp. Please reply. outp=$(echo $OUTPUT | awk '{FS = "|"}{ for(i=0;i<NF;i++)... (8 Replies)
Discussion started by: vijaykrc
8 Replies

5. Shell Programming and Scripting

scp shell scripting question

HI all, I am attempting to use the scp statemet in a shell script that I am writing I need to have the user of the script enter a password at the time of the shell script running.I have the following questions? 1) how do i disable the automatic text echo when the user is entering the... (1 Reply)
Discussion started by: Segwar
1 Replies

6. UNIX for Dummies Questions & Answers

shell scripting question

Testing for the presence/absence of a pattern in a file, using /bin/sh: while read a; do b="${a##*pattern*}"; ; done < file This returns 0 if there's a match. That signal ($?) can then be used outside the loop. However this method reads through the whole file, even if the match... (2 Replies)
Discussion started by: uiop44
2 Replies

7. Shell Programming and Scripting

Question in shell scripting

Hello, I have a scenario for which I am trying to write a shell script and I have a question regarding the same. Here's the situation: I am trying to copy a directory which consists of a few sub-directories and .c and .dat extension files say n number of times so that the copied file have... (3 Replies)
Discussion started by: corntown118
3 Replies

8. Shell Programming and Scripting

Shell scripting question (Fedora 16)

Hi, I need to write a script that runs a series of commands in multiple subfolders. The problem is that I dont want to change directory for every folder. So this is why I thought to use a master script to activate the smaller ones. So, is there a way to command other scripts to open in... (9 Replies)
Discussion started by: Fuyudo
9 Replies

9. Shell Programming and Scripting

Shell Scripting Question

Hi guys, I am wanting to create a script that will logon to HackThisSite.org and complete Programming Mission 11. You can find a link to this mission here for your reference: www hackthissite org/missions/prog/11/ The following is what I have so far: #!/bin/bash USER="myUsername"... (0 Replies)
Discussion started by: spooke
0 Replies

10. Shell Programming and Scripting

Shell Scripting question with SQL

hey i have to connect to sql through shell script , then store the value of the query in a variable and then compare it after some time after running a process. i have used this code but it is not working. #!/bin/sh Val = (sqlplus -s rte/rted2@rel76d2 <<! SELECT MAX(STAT_ID) FROM CVT_STATS;... (3 Replies)
Discussion started by: ramsavi
3 Replies
SETUID(1)						      General Commands Manual							 SETUID(1)

NAME
setuid - run a command with a different uid. SYNOPSIS
setuid username|uid command [ args ] DESCRIPTION
Setuid changes user id, then executes the specified command. Unlike some versions of su(1), this program doesn't ever ask for a password when executed with effective uid=root. This program doesn't change the environment; it only changes the uid and then uses execvp() to find the command in the path, and execute it. (If the command is a script, execvp() passes the command name to /bin/sh for processing.) For example, setuid some_user $SHELL can be used to start a shell running as another user. Setuid is useful inside scripts that are being run by a setuid-root user -- such as a script invoked with super, so that the script can execute some commands using the uid of the original user, instead of root. This allows unsafe commands (such as editors and pagers) to be used in a non-root mode inside a super script. For example, an operator with permission to modify a certain protected_file could use a super command that simply does: cp protected_file temp_file setuid $ORIG_USER ${EDITOR:-/bin/vi} temp_file cp temp_file protected_file (Note: don't use this example directly. If the temp_file can somehow be replaced by another user, as might be the case if it's kept in a temporary directory, there will be a race condition in the time between editing the temporary file and copying it back to the protected file.) AUTHOR
Will Deich local SETUID(1)
All times are GMT -4. The time now is 05:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy