10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello i am having an issue with bash script and this is the code
now=$(cat hosts1.txt | awk '{print $2;}')
while read n ;do
ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers'
When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
2. Shell Programming and Scripting
john-test:/root> ssh -q chicago-ser uname;date
Linux
Fri Oct 13 16:41:11 GMT 2017
How I can print on the same line like this :
Linux Fri Oct 13 16:41:11 GMT 2017 (2 Replies)
Discussion started by: jhonnyrip
2 Replies
3. Shell Programming and Scripting
Hi, I've an issue in a shell script:
I'm opening an ssh connection to a remote server, then I want to store the result of a ls command in a variable, but it doesn't work: the ls is done on the local machine.
ssh user@server << EOF
ls # works as expected (ls is done remotely)
test=`ls` # the... (1 Reply)
Discussion started by: seloum57
1 Replies
4. Shell Programming and Scripting
Hi,
i have a shellscript, where in i need to connect to different server start these three jobs and exit from the server and start the same three jobs on local server.
ssh user@remotehost 'bash -s' << EOF
${GETT_HOME}/bin/start1 &
sleep 10
${GETT_HOME}/bin/start2 &
sleep 10... (1 Reply)
Discussion started by: swapnabhargav
1 Replies
5. Shell Programming and Scripting
Hello again :) ,
My script has an ssh command to run a script on a remote machine. The script has commands such as sqlplus and unzip. However, the return I get in my own terminal says it can't find sqlplus and unzip.
the ssh command is:
ssh user@host "cd ScriptDir; ./Script.sh"
and the... (6 Replies)
Discussion started by: jangozo
6 Replies
6. Shell Programming and Scripting
Hi all,
Scenario - trying to run a batch job on a second machine.
DIR=directory
user=user
server=server
Here is what i have- ssh user@server 'sleep2; cd $DIR; <jobname>'
I have got access to the correct directory, i checked with a pwd command previous.
Problem is the job i... (1 Reply)
Discussion started by: Hopper_no1
1 Replies
7. Shell Programming and Scripting
i have a bash script on serverA, when i run the script on the server, it runs fine. the way to run the script is like this ./script "option1"
Now i am trying to call it from local laptop using ssh command, my command is as the following
ssh serverA ~/script "option1"
and i got error... (7 Replies)
Discussion started by: fedora
7 Replies
8. UNIX for Dummies Questions & Answers
Hello sir,
Im using ubuntu distro.
We all know that ssh is used for password less entry.So, I have the public key and the IP address and the username thats it. Now to login it to the system either I should have password or a private key.Now I have the blacklist of private/public keys. But I dont... (1 Reply)
Discussion started by: nsharath
1 Replies
9. Shell Programming and Scripting
Hi,
WHen I login to the host using ssh, it sources bash_profile then bashrc file, and reads in my path and other variables.
But when I want to execute a command remotely, it is not sourcing my bash_profile or bashrc files and I dont get the env I want. THis is causing a lot of problems.
HOw... (1 Reply)
Discussion started by: sardare
1 Replies
10. Shell Programming and Scripting
Hi guys,
I am trying to do a ssh for performing a set of actions.
Find it below:
I need to put the user/ kernel/ DISTRO variables before I complete this operation.
what I observed is when ever I put a `command` in those quotes, it performs thta action in local system rather than remote one.... (5 Replies)
Discussion started by: jbmukund
5 Replies