remote shell access
Remote (and secure) access to another system makes use of the ssh package.
At its simplest, this provides secure copying from one machine to an account on another remote machine:
Login to the other machine can be automated by creating a private/public key pair to sign the access. The public key is added to the authorized keys of the destination account. The private key must be kept secure.
Sometimes it can be useful to forward X11 sessions over ssh (ie, to remotely run applications with a GUI). The X11Forwarding flag needs to be enabled in the /etc/ssh/sshd_config configuration file of the remote machine:
And then the ssh daemon restarted:
The remote GUI application can be run:
Multiple ssh connections to the same machine can be made more efficient by sharing the session. The following changes are made to the /etc/ssh/ssh_config of the client:
It makes security sense to restrict which users can ssh into a machine, by setting AllowUsers in the /etc/ssh/sshd_config:
At its simplest, this provides secure copying from one machine to an account on another remote machine:
Code:
scp file user@remote_machine:~
Code:
ssh-keygen ssh remote_machine sh -c 'cat >>.ssh/authorized_keys' <id_rsa.pub
Code:
set X11Forwarding yes
Code:
/etc/init.d/ssh restart
Code:
ssh -XC remote_machine application
Code:
ControlMaster auto ControlPath ~/.ssh/%r@%h:%p
Code:
AllowUsers user1@client_machine1 user2@client_machine2
Total Comments 1
Comments
-
I'm a big fan of installing fail2ban when sshd is running...
Posted 05-08-2011 at 02:04 PM by rich_c