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
How should i make the following code working
#!/bin/bash
INPUTFILE="test.txt"
while read STRING; do
IP=`host -t A $STRING | awk '{print $NF}'`
HOSTNAME=`ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no $IP "hostname"`
echo $HOSTNAME > out.txt
done < $INPUTFILE
At this moment while... (3 Replies)
Discussion started by: urello
3 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
Hi all,
I am facing the following issue:
Host A should execute a remote command (say pwd) on host B2.
B2 is not directly reacheable but you have to connect from a to B1, then from B1 you can execute the command ssh user@B2 pwd.
B1 and B2 are directly connected:
A => B1 => B2
| ... (3 Replies)
Discussion started by: Evan
3 Replies
6. 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
7. Shell Programming and Scripting
Gurus,
I have written a shell script to backup a database and applications. This is how the script works:
1. As applications user (say applmgr), the main backup script, say backup.sh, is kicked off.
2. backup.sh does ssh to oracle user and kicks off the database backup using nohup and... (1 Reply)
Discussion started by: sunpraveen
1 Replies
8. OS X (Apple)
Recently whenever I log out of an SSH session, or copy something using SCP, I get no response from my shell.
Running with ssh -v showed no errors when exiting.
Normally I could deal with this, but I believe it's causing errors elsewhere when scripts try to download things from external... (0 Replies)
Discussion started by: keymakerOvvvv
0 Replies
9. Shell Programming and Scripting
Hi, could anyone please tell me how to ssh to remote host foo and execute command on it and print the result on local host?
Thanks,
Paresh (1 Reply)
Discussion started by: masaniparesh
1 Replies
10. 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