Sponsored Content
Top Forums Shell Programming and Scripting SSH with and without command gives different results Post 302356226 by pludi on Friday 25th of September 2009 01:55:18 AM
Old 09-25-2009
If your script needs interactive input, it might fail because of that. SSH will not, when not logging in, allocate a TTY, but just pipe back stdout/stderr and the exit code. Also, it will not invoke a login shell, so any personalized .login/.profile/.bash_profile will be left out. If you rely on a $PATH set in one of those it might fail too.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to output the results of the AT command - properly!

Hi, I am new to UNIX and I am more used to simple commands like those in VMS. One of them is the ability to get the output from a job using the /out=<file> command in VMS. I want to submit a job (a set of unix commands) using the AT command but to get the output in a file like that used in... (4 Replies)
Discussion started by: SpanishPassion
4 Replies

2. Shell Programming and Scripting

edit results of a find command

Hi Purpose is to have a utility command to find and edit files . I tried a function like the following in my .profile file function vifind(){ find . -name $1 -print -exec vi {} \; } Is this correct? is there a better way to do it? I see this behaving a bit strange in case of AIX, and... (6 Replies)
Discussion started by: grep_whoami
6 Replies

3. Solaris

How to use Secure Shell (SSH) to pass results back to invoking machine

Hi, I am running a script from a client machine X which does "SSH" to around 100 other machines in a farm and invokes a local script on each of those machines. Local script localscript.sh on each of those 100 target machines, does some machine specific function like fetch the specific machine's... (1 Reply)
Discussion started by: waavman
1 Replies

4. Linux

How to receive results from processes spawned on external machines using SSH

I am trying to get the number of cpus on a farm of linux boxes (about 100 of them) by 'sshing' to each of them and checking their /proc/cpuinfo file. So I have a local script localscript.sh on each of those 100 machines which retrieves the number of cpus in it by using its /proc/cpuinfo file.... (1 Reply)
Discussion started by: waavman
1 Replies

5. UNIX for Dummies Questions & Answers

Setting the Results of a Command to a Variable

Hi, Hi, I run the command: hostname to get the host back from the server: db201 Now, I need to take that result and set it to a variable. Can anyone help me with this?? I need to be able to use the same script on multiple servers so I do not want to hardcode the hostname result into... (1 Reply)
Discussion started by: stky13
1 Replies

6. Shell Programming and Scripting

Results of command execution into array

Hi Can anybody tell me how can I dump the results of execution of a command into array form? For example, I want to execute: and put each part of the result in an array element: Thanks (2 Replies)
Discussion started by: alirezan
2 Replies

7. Shell Programming and Scripting

getting results after using ps command

Hi, I want to use the following ps coomand: ps -ef | grep test Result of this command is: Test 161220 1 0 Oct 04 - 1:11 /test/test Just mentioning the description of each value in the result: UID PID PPID C STIME TTY TIME CMD Test 161220... (11 Replies)
Discussion started by: yale_work
11 Replies

8. UNIX for Dummies Questions & Answers

df and du command showing different results

I recently encountered this on the AIX system df command showed usage is 100% i.e 1.5 GB while du command showed usage is only 500MB Why are the 2 commands showing different output This command shows usage is 1.5 GB nlxdsm29:deqadm 24> df -k . /usr/sap/DEQ ... (3 Replies)
Discussion started by: ameya_joshi
3 Replies

9. Shell Programming and Scripting

Echoing command results

Sorry folks, Second time today. I am working on a script that accepts data via pipe and processes it. I expect it to work as: # command | ProcScript.sh Within ProcScript.sh, I want to be able to give the target of the prev run command I am using history 2 | grep -v history | awk... (18 Replies)
Discussion started by: Marc G
18 Replies

10. Shell Programming and Scripting

Cannot get results from grep command

Hi, i have a file hello.log which as several line that look like the below 2015-12-07 09:46:56 0:339 120.111.12.12 POST /helloWorld 2015-12-07 09:46:57 0:439 122.111.12.12 POST /helloWorld .... when i grep expecting to see results like the below. ... (6 Replies)
Discussion started by: mohtashims
6 Replies
SSH-COPY-ID(1)						      General Commands Manual						    SSH-COPY-ID(1)

NAME
ssh-copy-id - install your public key in a remote machine's authorized_keys SYNOPSIS
ssh-copy-id [-i [identity_file]] [user@]machine DESCRIPTION
ssh-copy-id is a script that uses ssh to log into a remote machine and append the indicated identity file to that machine's ~/.ssh/autho- rized_keys file. If the -i option is given then the identity file (defaults to ~/.ssh/id_rsa.pub) is used, regardless of whether there are any keys in your ssh-agent. Otherwise, if this: ssh-add -L provides any output, it uses that in preference to the identity file. If the -i option is used, or the ssh-add produced no output, then it uses the contents of the identity file. Once it has one or more fin- gerprints (by whatever means) it uses ssh to append them to ~/.ssh/authorized_keys on the remote machine (creating the file, and directory, if necessary.) NOTES
This program does not modify the permissions of any pre-existing files or directories. Therefore, if the remote sshd has StrictModes set in its configuration, then the user's home, ~/.ssh folder, and ~/.ssh/authorized_keys file may need to have group writability disabled manu- ally, e.g. via chmod go-w ~ ~/.ssh ~/.ssh/authorized_keys on the remote machine. SEE ALSO
ssh(1), ssh-agent(1), sshd(8) OpenSSH 14 November 1999 SSH-COPY-ID(1)
All times are GMT -4. The time now is 04:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy