Posts

Showing posts with the label ssh

Web ssh.

Image
Use this at your own risk as it is probably not safe to use. There are may web based ssh modules to use and this is just one of them. they are nice if you are operating from a tablet and do not have a desktop machine. Just fire up the html file, choose a server and then log in as you would with ssh. More info at:  http://weavervsworld.com/ssh/ssh.php  You will need several jar file and an html file to put it all together.  The files: mindterm312.jar  mindterm312.weavselfsign.jar  term.html Here is a typical html file that can be on a server or even a local machine. [code]  <html> <body>  <h4 class='heading'>Mindterm Applet Information</h4>     <p class='centererror'><b>Keep this window open after the applet has loaded.</b></p>    <object codetype='application/java-archive' classid='java:com.mindbright.application.MindTerm.class' archive='mindterm312.weavself...

Secure yourself.

Image
Linux commandment: Thall shall not login remotely as root. If your a good linux admin, you did this when you first set up the machine. $ cd /etc/ssh $ sudo vim sshd_config Change the line that says permit Root login to no /Roo in vim should find the line quickly # Authentication: LoginGraceTime 120 # PermitRootLogin yes PermitRootLogin no StrictModes yes Save and exit the file. Restart the service: $ sudo service ssh restart

Talk to me.

Image
 Computers are robots without arm or legs. You may want to read this first. http://www.instructables.com/id/Text-to-speech-with-linux/  You may also want to setup automatic login into C1 and C2. i.e. On C3: $ ssh-keygen -t rsa If .ssh directory is already setup and security is not a real issue just press return at all the prompts. $ cd .ssh $ scp .ssh./id_rsa.pub C1:~/. $ scp .ssh./id_rsa.pub C2:~/. If you have rights on C1 and C2, For C1 and C2: You will want to log into them and add the .pub file to the  authorized_keys file. $ cd .ssh $ cat ../id_rsa.pub > authorized_keys Now you can login easily or send commands remotely without having to type in passwords for C3. You could login into C2 and C1 and type the command: $ echo this is a test | festival --tts And you would hear This is  a test from the speakers assuming are turned on and the volume was loud enough. But we might not want to log into C2 or C1 so that To test the speake...

ssh-copy-id.

Image
Replace traditional command to install ssh-keys cat ~/.ssh/id_rsa.pub | ssh usr@host’cat >> .ssh/authorized_keys’ With a single command: ssh-copy-id -i ~/.ssh/id_rsa.pub user@host SSH-COPY-ID(1) BSD General Commands Manual SSH-COPY-ID(1) NAME ssh-copy-id — use locally available keys to authorise logins on a remote machine SYNOPSIS ssh-copy-id [-n] [-i [identity_file]] [-p port] [-o ssh_option] [user@]hostname ssh-copy-id -h | -? DESCRIPTION ssh-copy-id is a script that uses ssh(1) to log into a remote machine (presumably using a login password, so password authentication should be enabled, unless you’ve done some clever use of multiple identities). It assembles a list of one or more fingerprints (as described below) and tries to log in with each key, to see if any of them are already installed (of course, if you are not using ssh-agent(1) this may result in you being repeatedly prompted for pass-phrases). It then assembles a list of those that fai...

Let's build a tunnel.

Image
Ever want to access your own site with a bit of privacy? Tunnelling can be a way to do that. It does require user rights on the intended machine to be the host. If yoy look at a web site, you see the normal url something.something. sitetype. In this case we are just going to oeorgan1. Bue what we would like to do is try to encrypt the connection between the two machines. One traditional way to do it is using the secure shell (SSH) , but you could probably also use a program called putty.  Here is the simplest version: ssh [-1246AaCfgkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec] [-D port] [-e escape_char] [-F configfile] [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-R [bind_address:]port:host:hostport] [-S ctl_path] [user@]hostname [command]  $ sudo ssh  -L 80:localhost:80 eddie@oeorgan1 But if we did this it would open a prompt that I do not want. if we use ...

Admin trick.

Image
Need command line access, but the device you are using does not support a command line interface. Answer, set up a server or get access to a server with webmin installed. Then just use the command line interface via webmin. or install firessh in a browser. or set up a jar file on the local machine. Download the software http://weavervsworld.com/ssh/mindterm312.jar or http://weavervsworld.com/ssh/mindterm312.weavselfsign.jar Then set up an html file either locally on on a server such as term.html. Then load term.html into your browser. <html> <body>  <h4 class='heading'>Mindterm Applet Information</h4>     <p class='centererror'><b>Keep this window open after the applet has loaded.</b></p>    <object codetype='application/java-archive' classid='java:com.mindbright.application.MindTerm.class' archive='mindterm312.weavselfsign.jar'>     <param name='sepframe' val...

Password not required.

Image
There are many times when I do not want to always keep typing in passwords to log into local servers. Not only that, I do not want to be typing passwords when people are watching.  If you run a primarily linux network like I do then this can be a real boon to your use of the systems not to have to do the traditional login. So we will need a way to authenticate to the systems we want to use.. There was traditionally two kinds of authentication. RSA and DSA. RSA should not be used any more.  Public key authentication can only be established on a per system / user basis only i.e. it is not system wide. You will be setting up ssh with DSA public key authentication for SSH version 2 on two machines. Note: you will need to be able to use the command line/terminal for this project. Note: For both the server and the client port 22 should be changed to some number above 1024 that is an unused port.  Both numbers must be the same unless you are a...

Reverse Internet tunnels

Image
Under construction. Have you ever wanted to ssh to your Linux box that sits behind NAT? Now you can with reverse SSH tunneling. This document will show you step by step how to set up reverse SSH tunneling. The reverse SSH tunneling should work fine with Unix like systems. Let's assume that Destination's IP is 192.168.20.55 (Linux box that you want to access). You want to access from Linux client with IP 138.47.99.99 . Destination ( 192.168.20.55 ) <- |NAT| <- Source ( 138.47.99.99 ) 1. SSH from the destination to the source (with public ip) using command below: ssh -R 19999:localhost:22 sourceuser@138.47.99.99 * port 19999 can be any unused port. 2. Now you can SSH from source to destination through SSH tuneling: ssh localhost -p 19999

Sshkey install update.

Wrote a script a while back to put your ssh key on a remote system so you do not have to type in the password all the time. Found a few shortcomings with it and now have updated it. You will have to type in your password to login and complete the script process. installkey.sh # invoke with ./Installkey.sh servername # set up the .ssh dir if it does not exist DIRECTORY=",ssh" ssh $1 'if [ ! -d "$DIRECTORY" ];  then  mkdir $DIRECTORY ;chmod 700 $DIRECTORY ; fi' # copy the key scp $DIRECTORY/id_dsa.pub $1:~/. # install the key ssh $1 'cat id_dsa.pub >> $DIRECTORY/authorized_keys' ssh $1 'chmod 600 $DIRECTORY/authorized_keys ' # remove the public key you just copied ssh $1 'rm ~/id_dsa.pub'

Proxy.

Image
You may want to surf internet a bit more carefully. That is you do not want the sites you go to to know where you are surfing from.   Here is one way to achieve that, You will need to use a program called SSH and you will need a shell account on a server no where you are. Copied a short piece of code to  test what ipaddress we were surfing from on the local server. Getmyip.php <?php header(“Cache-Control: no-cache, must-revalidate”); header(“Expires: Mon, 26 Jul 1997 05:00:00 GMT”); header(“Content-Type:text/javascript;charset=utf-8″); if (!empty($_GET)) { // lecture du GET et execution des tâches } exit(“alert(‘Your ip address is: “.$_SERVER['REMOTE_ADDR'].”‘);”); ?> After installing that file on the server where it would be easily accessible, I tested it out. That was the correct ipaddress so what’s next? We need to get access to the shell account we want to use via ssh. So we will for deminstrations purposes will just use te server oesrvr1. $ ssh -D localhost:999...

Proxy.

Image
You may want to surf internet a bit more carefully. That is you do not want the sites you go to to know where you are surfing from.   Here is one way to achieve that, You will need to use a program called SSH and you will need a shell account on a server no where you are. Copied a short piece of code to  test what ipaddress we were surfing from on the local server. Getmyip.php <?php header(“Cache-Control: no-cache, must-revalidate”); header(“Expires: Mon, 26 Jul 1997 05:00:00 GMT”); header(“Content-Type:text/javascript;charset=utf-8″); if (!empty($_GET)) { // lecture du GET et execution des tâches } exit(“alert(‘Your ip address is: “.$_SERVER['REMOTE_ADDR'].”‘);”); ?> After installing that file on the server where it would be easily accessible, I tested it out. That was the correct ipaddress so what’s next? We need to get access to the shell account we want to use via ssh. So we will for deminstrations purposes will just use te server oesrvr1. $...

Nexus 7 - second thoughts.

Image
The Nexus seven is beginning to grow on me despite limitations I could easily get around with a linux box. Yes you can install linux on the touchpad, but it is still not a complete adaption last I heard. Then too, you lose the Android environment. Seems that more and more applications want you to root your system if you want to take advantage of their software. In someways that could be a deal breaker, Thought about getting a cheap tablet to experiment with that and keep the Nexus seven a bit more private. First project was to see if I could serve out a gpxe linux install from the Nexus 7.  It would be so neat to be able to start a linux install on a traditional pc from a tablet device. Already do this all the time from a regular server (see the last article). For some reason of the web servers I tried for the android they were not up to the challenge,  Disappointing, but not the end of the world. There are some plus sides to having the server, You can run html and javascript ...