LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Blogs > neonsignal
User Name
Password

Notices

Rate this Entry

remote shell access

Posted 05-08-2011 at 07:03 AM by neonsignal
Updated 05-08-2011 at 08:06 AM by neonsignal

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:
Code:
scp file user@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.
Code:
ssh-keygen
ssh remote_machine sh -c 'cat >>.ssh/authorized_keys' <id_rsa.pub
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:
Code:
set X11Forwarding yes
And then the ssh daemon restarted:
Code:
/etc/init.d/ssh restart
The remote GUI application can be run:
Code:
ssh -XC remote_machine application
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:
Code:
ControlMaster auto
ControlPath ~/.ssh/%r@%h:%p
It makes security sense to restrict which users can ssh into a machine, by setting AllowUsers in the /etc/ssh/sshd_config:
Code:
AllowUsers user1@client_machine1 user2@client_machine2
Posted in Uncategorized
Views 2255 Comments 1
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    I'm a big fan of installing fail2ban when sshd is running...
    Posted 05-08-2011 at 02:04 PM by rich_c rich_c is offline
 

  



All times are GMT -5. The time now is 09:07 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration