Help a noob with remote access.

Associate
Joined
13 Jan 2010
Posts
2,032
Location
A box in the Astral Plane
Hey peeps!

I was hoping that you could help me with remote access on my Ubuntu install, I'm new to this and need some guidance. :)

I've got some Cisco devices at home, which are connected via a console cable to my PC. I want to be able to access
the Cisco devices remotely by connecting to the console cable connected to the PC, and not the Cisco kit itself.

I've used ser2net to allow local computers to access the console ports on the Ubuntu PC via telnet, and would like
to use SSH instead as it is more secure.

This is where I'm stuck. I have no idea how to configure SSH in Linux (or on anything for that matter).

For telnet all I had to do was give each of my local console cables their own port, then telnet to the IP
address of my Ubuntu PC with the port name of a console cable after it. telnet 192.168.0.1 2000
and whatever. Totally new to SSH and Linux though so help is very much appreciated!

Thanks. :)
 
First install ssh

sudo apt-get install openssh-server

Then you can connect in from another machine. From Linux use the command "ssh" to connect. From windows use something like Putty to connect. From linux do a..

ssh [email protected]

..and it should ask for the password for user.

Once connected you can use telnet to connect to port 2000. I'm sure there is a better way but this should work.
 
Last edited:
As masterluke has mentioned above, that is correct for installing and using ssh. Are you going to be opening ports on your router and accessing this home machine, while say at work?

If yes, you'll need to lock down ssh a bit more.
 
I had almost forgotten about this thread!

Yes, I shall be accessing it from outside of the local network. :)

I know almost nothing about SSH, apart from the fact that it's a lot more secure than Telnet. Care to help a noob out? :p

I'm able to remotely connect to my Linux box remotely using SSH, but I've only done as masterluke has said above,
nothing else to help ensure that the connection is secure.
 
"openssh-server" is the onl thing you need to install, then forward port 22 on your router to your server, and voila (providing iptables isnt running!).
 
ok cool, so you've opened port 22 on your router and can connect from the outside?

As kia mentioned, keys would be the best and most secure way of accessing your machine via ssh. First thing i'd do is change the port you access it on, security via obscurity. If you check /var/log/auth.log, you'll probably see bots trying to brute force your ssh password. Like this from one of the ubuntu threads:

http://ubuntuforums.org/archive/index.php/t-1939643.html

The first time I installed ssh, I did it on a ubuntu server VM with another VM accessing it, I had a lot of help from the guys on the ubuntu forums before opening it up to the internet. I now go through the following steps before I open ssh up to the net, other people might have more to add.

sudo nano /etc/ssh/sshd_config
change port 22 to port XXXX
change loginGraceTime 120 to LoginGraceTime 20
PermitRootLogin to no
change log level from INFO to VERBOSE

sudo /etc/init.d/ssh restart

To use Public keys: On the device that is going to connect to the server/machine:

mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa -b 4096
cd .ssh
ssh-copy-id -i id_rsa.pub [email protected]

On the server/machine:

sudo nano /etc/ssh/sshd_config
change PasswordAuthentication to no and delete the #

sudo /etc/init.d/ssh restart

Then try and connect, it should work (fingers crossed). I would also recommend installing fail2ban or denyhosts, it monitors how many times bots try to connect to the ssh server and blocks the IP's after a couple of times.

Hope that helps, guys anything to add to this?
 
Thanks for the advice guys, much appreciated! :) Will get round to doing what has been recommended when I am using the Linux box next!
 
Back
Top Bottom