Weblog entry #1 for prhlava
beginner sysadmins could find a couple of tricks with the secure shell useful...
Comments on this Entry
[ Send Message | View sebastian's Scratchpad | View Weblogs ]
But "Transferring files over ssh", why don't use SCP? :-)
Cheers, <a href="http://www.thenetwork.nl"; title="Sebastian Online">Sebastian</a>
[ Parent | Reply to this comment ]
the scp point is valid, i will add it to the article...
[ Parent | Reply to this comment ]
One more trick for SSH.
Assuming you have set password less login [1].
e.g.
I have three server red, blue, green (host to ip mapping has ben done in /etc/hosts file). I have set password less login [1] with my LAPTOP. Make small script call "ssh-to-server" in /tmp directory
----------------------
#!/bin/sh
ssh `basename $0` $*
----------------------
Now copy above script to /sbin, make it executable
#chmod 755 /tmp/ssh-to-server
#cp /tmp/ssh-to-server /sbin/
Now make soft link of each server (red, blue, green)
#ln -s /tmp/ssh-to-server /sbin/red
#ln -s /tmp/ssh-to-server /sbin/blue
#ln -s /tmp/ssh-to-server /sbin/green
#rm /tmp/ssh-to-server
Thats's it! Just type
#red uptime
17:25:14 up 55 days, 3:57, 2 users, load average: 0.12, 0.09, 0.05
[1] http://www.biostat.jhsph.edu/bit/nopassword.html
--
Hardik Dalwadi
National Innovation Foundation(NIF)
(http://nifindia.org)
Fan of deepOfix (http://deeproot.in)
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
--
Hardik Dalwadi,
SysAdmin, National Innovation Foundation.
http://nifindia.org
deepOfix Developer
http://deeproot.in
[ Parent | Reply to this comment ]
[ Send Message | View dkg's Scratchpad | View Weblogs ]
otherwise, it appears you'll end up with some broken symlinks in /sbin.
Also, i'd recommend putting this sort of thing in /usr/local/sbin and not /sbin. According to the FHS, which debian adheres to, /sbin and /usr/sbin should be managed by the OS's package manager (dpkg, for debian). /usr/local/sbin, otoh, is totally open for the sysadmin.
This avoids possible conflicts if, say, some package later wants to install something as /sbin/red.
[ Parent | Reply to this comment ]
Good catch, It was my mistake, it must be ...
#ln -s /sbin/ssh-to-server /sbin/red
in general.And thanks for comment on /sbin, I think you i
must put those script and links in /usr/local/sbin, so
it would be perfect Debian spcecific SSH tips. Below
is revised part for that.
#cp /tmp/ssh-to-server /user/local/sbin/
Now make soft link of each server (red, blue, green)
#ln -s /usr/local/sbin/ssh-to-server /usr/local/sbin/red
#ln -s /usr/local/sbin/ssh-to-server /usr/local/sbin/blue
#ln -s /usr/local/sbin/ssh-to-server /usr/local/sbin/green
#rm /tmp/ssh-to-server
Again thanks...
So,
Can we make article for "Debian specific SSH tips" ?
--
Hardik Dalwadi,
http://nifindia.org
Fan of deepOfix
http://deeproot.in
[ Parent | Reply to this comment ]
Basically, you create a sym link to /usr/bin/ssh-argv0 and give it the name of the host, like so:
ln -s /usr/bin/ssh-argv0 /sbin/host.name.com
Then, to SSH into host.name.com you can just run that sym link, just like with hardik's method:
host.name.com
or
host.name.com ls -l
[ Parent | Reply to this comment ]
I think, i have reinvented the wheel, but try was not bad!
--
Hardik Dalwadi,
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]