Posted: . At: 11:20 AM. This was 6 years ago. Post ID: 12067
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



How to ssh into a Linux machine easily from your Ubuntu PC.


SSH is a great way to connect to a remote Linux server over a network. This is how to use SSH easily yourself.

Firstly, install SSH on the remote machine to allow remote connections if it is a server you are setting up.

sudo apt install ssh

Then run this command on the client to connect to the server.

jason@Yog-Sothoth:~$ ssh jason@192.168.1.4
jason@192.168.1.4's password: 
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-144-generic x86_64)
 
 * Documentation:  https://help.ubuntu.com/
 
New release '16.04.4 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
 
Last login: Tue Apr 24 19:45:03 2018 from blufor.local

Just provide the SSH password and the login will work. There is also provision for using a key instead of a password to connect to a remote machine.

How to setup an SSH login using host keys instead of a password.

http://securitronlinux.com/debian-testing/how-to-setup-an-ssh-login-using-host-keys-instead-of-a-password/.

This will allow simple, but secure connections from a client to a server machine. But make sure the host keys cannot be stolen from the server or client machines, this means someone else could logon as you.

How to leave a command running when your SSH session is disconnected.

http://securitronlinux.com/bejiitaswrath/how-to-leave-a-command-running-when-your-ssh-session-is-disconnected/.

Useful SSH tricks for downloading files from an SSH server to your machine.

http://securitronlinux.com/bejiitaswrath/useful-ssh-tricks-for-downloading-files-from-an-ssh-server-to-your-machine/.

How to show a banner explaining terms of use for an SSH connection before login.

http://securitronlinux.com/debian-testing/how-to-show-a-banner-explaining-terms-of-use-for-an-ssh-connection-before-login/.

How using ssh is a better way to access your remote machine. How to do this over port 443.

http://securitronlinux.com/bejiitaswrath/how-using-ssh-is-a-better-way-to-access-your-remote-machine-how-to-do-this-over-port-443/.

There is also a way to temporarily connect to a remote machine over SSH, run a command, and then exit immediately.

This is an example.

jason@Yog-Sothoth:~$ ssh jason@192.168.1.4 -p 22 -t "ps ax | unity"
jason@192.168.1.4's password: 
WARNING: no DISPLAY variable set, setting it to :0
stop: Unknown job: unity-panel-service
start: Unknown job: unity-panel-service
compiz (core) - Info: Loading plugin: core
compiz (core) - Info: Starting plugin: core
compiz (core) - Error: Another window manager is already running on screen: 0
compiz (core) - Info: Stopping plugin: core
compiz (core) - Info: Unloading plugin: core
Connection to 192.168.1.4 closed.

This is how to get quick information from a remote machine using a simple one-liner. Very useful indeed.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.