Ssh

SSH Reverse DNS Lookup Disable

/etc/ssh/sshd_config:

UseDNS no

source

By WladyX on 15 December, 2011 | Ssh | A comment?

ssh-keygen & ssh-copy-id

ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub root@ip

By WladyX on 14 December, 2011 | Ssh | A comment?

SSHplus

sshplus rename to sshplus.py

If there is no icon, change:
ind = appindicator.Indicator("simplestarter", "network-transmit-receive",

source source2

By WladyX on 14 October, 2011 | Cool Apps, Ssh, Ubuntu | 1 comment

Force ssh to ask for password

ssh -o PreferredAuthentications=password user@host.com

source

By WladyX on 22 September, 2011 | Ssh | A comment?

rsync your Android

In combination with dropbear or QuickSSH rsync allows you to back up your android. Here’s how to.

Getting the binaries

You can find the binaries here.

  1. Download:

wget http://adqmisc.googlecode.com/svn/trunk/androidutils/rsync/rsync-3.0.6-arm-softfloat-linux-gnueabi.gz

  1. Decompress:

zcat rsync-3.0.6-arm-softfloat-linux-gnueabi.gz > rsync

  1. Copy rsync to your phone, make sure it’s in the PATH and chmod 755 rsync. I have put mind to QuickSSH’s homedir (/data/data/com.teslacoilsw.quicksshd/dropbear or /data/data/berserker.android.apps.sshdroid/dropbear).

Examples

Here are a few examples that can be scripted.

Initiate a backup from your phone:

  rsync  -e "ssh -p <port>" -vrt <local-source> <user>@<server>:/<path>
  e.g. rsync -e "ssh -p 443" -vrt /mnt/sdcard/astrid me@<my-ip>:/home/me/temp

Initiate a backup from your server:

  rsync rsync -vrt -e "ssh -p <port>" <user>@<phone>:/<path> <local-dest>
  e.g. rsync -vrt -e "ssh -p 2222" <user>@android:/mnt/sdcard/astrid /home/me/temp

source source2
By WladyX on 5 August, 2011 | Android, Ssh | A comment?

Configuring QuickSSHD for pub/privkey

1. Create a dsa-key-pair on your linux client

  ssh-keygen -t dsa -f id_dsa-android

Note: I named the key id_dsa-android because that’s my own convention

2. Copy the public key to your Android device

  scp -P 2222 id_dsa-android.pub <your-ip-goes-here>:/sdcard

Note: This assumes you have password enabled and sshd running on port 2222

3. Validate the public key

  cat /sdcard/id_dsa-android.pub >>
  /data/data/com.teslacoilsw.quicksshd/home/.ssh/authorized_keys

Note: Validating means in this case to copy the pubkey to authorized_keys (it’s located in /data/data/com.teslacoilsw.quicksshd/home/.ssh)

4. Configure Go to your QuickSSHD settings and remove the checkbox Password and check Shared Keys (If you did right the key added to authorized_keys should be listed right under the checkbox.

5. Test

  ssh -i <your-home-goes-here>/.ssh/id_dsa-android -p 2222 <your-ip-goes-here>

If everything went fine you should get:

  Enter passphrase for key '/home/sven/.ssh/id_dsa-android'

source
By WladyX on | Android, Security, Ssh | A comment?

Chrooted SFTP accounts without shell access

  1. Create a user group, e.g. sftponly
  2. Add users to that group
  3. Add a corresponding Match directive to sshd‘s configuration in /etc/ssh/sshd_config:
Subsystem sftp internal-sftp

Match Group sftponly
        ChrootDirectory %h
        AllowTCPForwarding no
        X11Forwarding no
        ForceCommand internal-sftp

source
By WladyX on 24 March, 2011 | Security, Ssh | A comment?

Sshfs

add user to fuse group
$ sshfs server:/path/ /media/path/

source

By WladyX on 26 January, 2011 | Ssh | A comment?

pssh

pssh provides parallel versions of the OpenSSH tools that are useful for controlling large numbers of machines simultaneously. It includes parallel versions of ssh, scp, and rsync, as well as a parallel kill command.

via

By WladyX on 24 January, 2011 | Ssh | A comment?

Colored motd

[user@box]$ echo -en "\033[1;34m" > /etc/motd
[user@box]$ echo "Text of your motd file....." >> /etc/motd
[user@box]$ echo -en "\033[0m" >> /etc/motd

source

By WladyX on 13 January, 2011 | Scripts, Ssh, Style | A comment?