Just a quick question about SSH


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Just a quick question about SSH
# 1  
Old 02-20-2008
Just a quick question about SSH

Hi all,

Just a quick question about using ssh. I have already searched all over the Internet--- but am working on a big project tomorrow connecting to about 100 servers one at a time from my home server, using ssh

ssh -l root [hostname]


Once I connect in, can anyone recommend the easiest/safest way to grab a file from the home server? I have a script I'd like to upload and run on each one, while I'm logged in doing other work.
I've heard talk of scp but I can't confirm any examples, these servers will be root and I have little opportunity to experiment- thanks for any suggestions!
# 2  
Old 02-20-2008
Quote:
Originally Posted by jeffpas
Hi all,

Just a quick question about using ssh. I have already searched all over the Internet--- but am working on a big project tomorrow connecting to about 100 servers one at a time from my home server, using ssh

ssh -l root [hostname]


Once I connect in, can anyone recommend the easiest/safest way to grab a file from the home server? I have a script I'd like to upload and run on each one, while I'm logged in doing other work.
I've heard talk of scp but I can't confirm any examples, these servers will be root and I have little opportunity to experiment- thanks for any suggestions!
Do "scp theFile.txt remoteHost_Name:/targetDestination"
for example if you want to copy /tmp/test.txt from server "ServerA" to "ServerB" in /home/jsmith do this:

Logon to ServerA
cd /tmp
run " scp test.txt ServerB:/home/jsmith" I hope this helps.
# 3  
Old 02-21-2008
Does anyone know if there is a way to scp or get the file AFTER you have ssh'd on to SERVER2?

In other words:

get on SERVER 1
ssh -l root SERVER 2

(on SERVER 2)
# get the file from SERVER 1

It would be much easier than connecting twice for each server. Thanks for any advice!
# 4  
Old 02-21-2008
I may have misunderstood this but :
when you are logged on random server, whether 1 or 2, you can scp file in both directions, you can upload and download :
Code:
ssh root@server1
scp /path/to/file1 root@server2:/tmp/new-file-name2

and
Code:
scp root@server2:/tmp/new-file-name2 /opt/new-file-name1

# 5  
Old 02-21-2008
Yes this is what I am looking for. Very good! Using it already.

I assume from what I have read on the web there is no way to pass the password as a parameter in UNIX/AIX using ssh. We are connecting to a huge number of servers to distribute a program and have been given a list of 'possible passwords' to use. And of course the usual time crunch.

So for each server, I have to try logging in via ssh up to 10 or 15 times until I stumble across the right password. And in the traditional style each password is a knuckle crippling combination of case changes and numerical gibberish.




Wouldn't it be great to have a UNIX script that did something along the lines of (sorry if not accurate)


For X$ in 23j4Mto Np30252 34235jkmm r0t00pbo 2i2oPP 3?3j4k2 423323 .....
(list of passwords)
do

ssh -user SERVER -p PASSWORD(X$)
if SUCCESSFUL then
exit; hooray
end if

done


But I guess that's dreaming of OS convenience, undeserved.............
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Quick question

Hi guys Quick question Im creating an FTP server and im chrooting each user to there home directory blah blah. Ive also setup scponly so there locked etc. Im a novice at unix and have just reaslised the primary group of scponly is the username of one of the ftp users... which im sure... (1 Reply)
Discussion started by: mokachoka
1 Replies

2. UNIX for Dummies Questions & Answers

Quick question.

I'd like to list all userid's on the system that have a .bashrc file in their home directory with a command like "cat /etc/passwd | grep -f", however I'm not quite familiar with using grep. Any suggestions? (2 Replies)
Discussion started by: raidkridley
2 Replies

3. AIX

quick question

Hi, At best I'm a junior admin with a big problem. My developers have got my root password and mgmt insists they need it. I can't even change it when people knowing it leave. I'm certain they've hardcoded it into routines. I've searched my servers and grepped everything & can't find it. ... (5 Replies)
Discussion started by: keith.m
5 Replies

4. UNIX for Dummies Questions & Answers

Quick question

Hello all, Quick question from a fairly new to Unix developer. if then completedLogFile=$logfile.$(date +%Y%m%d-%H:%M:%S) mv $logfile $completedLogFile fi I understand that this portion of code is simply copying a tmp logfile to a completed logfile when a condition is true. The... (2 Replies)
Discussion started by: JohnnyBoy
2 Replies

5. UNIX for Dummies Questions & Answers

Quick question

Hi, Is there a simple way, using ksh, to find the byte position in a file that a stated character appears? Many thanks Helen (2 Replies)
Discussion started by: Bab00shka
2 Replies

6. UNIX for Dummies Questions & Answers

Quick Question

Hi, I am new to UNIX, and am learning from this tutorial : http://www.ee.surrey.ac.uk/Teaching/Unix/index.html It keeps telling me to files downloaded from the internet (like .txt files) to the directory, and I dont know how to. How do I add .txt files to my directory? Thanks. (6 Replies)
Discussion started by: IAMTHEEVILBEAN
6 Replies

7. UNIX for Dummies Questions & Answers

Another quick question

Hi guys sed -e "s/$<//g" the $< can allow me to assign an input value to the variable right? do the double quotes check the previous context? (1 Reply)
Discussion started by: hamoudzz
1 Replies

8. UNIX for Dummies Questions & Answers

quick question

hi guys trying to understand what this line means sed is a stream editor and i understand that, i have a file already selected i want to edit so i use -e sed -e the next stesp is s/$* s is a subsititute replacement sed -e s/$*//g $ is in reference of the last line /g makes it... (2 Replies)
Discussion started by: hamoudzz
2 Replies

9. UNIX for Advanced & Expert Users

Quick VI question

This "SHOULD" be a simple question, but looking through several books has turned up nothing, so I turn once again to the experts!! How do you vi a file so that you can see special characters. I believe my /etc/passwd file is being corrupted during an upgrade process, however the files... (6 Replies)
Discussion started by: Recon
6 Replies

10. UNIX for Dummies Questions & Answers

Quick Question

I know in DOS, when you want to pull up your last/previous command, you hit the up/down arrows. How do you do that with UNIX? (3 Replies)
Discussion started by: Tracy Hunt
3 Replies
Login or Register to Ask a Question