Need ideas: moving stuff to server
David A. Bandel
david
Sat May 14 11:47:25 PDT 2005
Regurgitating the prose of Michael Hipp Michael Hipp <Michael at hipp.com>
on Sat, 14 May 2005 10:21:42 -0500:
|This annoyance has bugged me for a while, would be grateful for a
|simple solution. Here goes ...
|
|I'm developing, say, an init script. I do the development/testing work
|in my favorite editor on my desktop. I don't want to "develop" stuff on
|
|a production server.
|
|Now I have a working version and want to put it in place on the server.
|
|Say it needs to land on the server as /etc/init.d/myscript. My only
|access to the server is ssh. So I scp it over. But it lands in my home
|directory. So I then log in via ssh, move it to where it goes, move
|over there, change ownership, change permissions, verify. Something
|like a 7-step process (scp, ssh, mv, cd, chown, chmod, ls).
|
|Any way to make this a 1-step process?
|
|Note that on none of my boxes is it allowed to ssh in as root and at
|least half of those steps require superuser privs.
Don't make is easy, do you? But if you can ssh in then become root,
what's the difference? If you're worried about dictionary attacks
against ssh as root, why not just disable password logins and only allow
via authorized_keys? That would fix several problems in one step.
Otherwise, I'd say you need to get a root key from the other system onto
your box as an authorized key, then put a script (mynewfile.sh) on the
other box that would take as arguments: your IP, script name (full
pathed on your box), path where you want the script to go, permissions
for file. Then just: ssh server mynewfile.sh mybox /home/me/myscript
/etc/init.d/myscript 755 <enter>
That would do it.
Ciao,
David A. Bandel
--
Focus on the dream, not the competition.
Nemesis Racing Team motto
GPG key autoresponder: mailto:david_key at pananix.com
More information about the Linux-users
mailing list