2015年3月18日水曜日

エラー key firefox

1)
エラー: key "7A4E76095D8A52E4" could not be looked up remotely
エラー: キーリングに必要なキーがありません
エラー: 処理を完了できませんでした (予期しないエラー)
エラーが発生したため、パッケージは更新されませんでした。


https://archlinuxjp.kusakata.com/wiki/Pacman-key?rdfrom=https%3A%2F%2Fwiki.archlinux.org%2Findex.php%3Ftitle%3DPacman-key_%28%25E6%2597%25A5%25E6%259C%25AC%25E8%25AA%259E%29%26redirect%3Dno#5.E3.81.A4.E3.81.AE.E3.83.9E.E3.82.B9.E3.82.BF.E3.83.BC.E3.82.AD.E3.83.BC.E3.82.92.E6.A4.9C.E8.A8.BC.E3.81.99.E3.82.8B

をみて

# pacman-key --init
 
# pacman-key --populate archlinux
 
==> archlinux.gpg からキーを追加...
==> キーリングの信頼されたキーに署名...
  -> キーに署名 0E8B644079F599DFC1DDC3973348882F6AC6A4C2...
  -> キーに署名 684148BB25B49E986A4944C55184252D824B18E8...
  -> キーに署名 44D4A033AC140143927397D47EFD567D4C7EA887...
  -> キーに署名 27FFC4769E19F096D41D9265A04F9397CDFD6BB0...
  -> キーに署名 AB19265E5D7D20687D303246BA1DFB64FFF979E7...
==> 所有者信頼値をインポート...
==> キーリングの破棄されたキーを無効化...
  -> キー F5A361A3A13554B85E57DDDAAF7EF7873CFD4BB6 を無効化...
  -> キー 7FA647CD89891DEDC060287BB9113D1ED21E1A55 を無効化...
  -> キー D4DE5ABDE2A7287644EAC7E36D1A9E70E19DAA50 を無効化...
  -> キー BC1FBE4D2826A0B51E47ED62E2539214C6C11350 を無効化...
  -> キー 4A8B17E20B88ACA61860009B5CED81B7C2E5C0D2 を無効化...
  -> キー 63F395DE2D6398BBE458F281F2DBB4931985A992 を無効化...
  -> キー 0B20CA1931F5DA3A70D0F8D2EA6836E1AB441196 を無効化...
  -> キー 8F76BEEA0289F9E1D3E229C05F946DED983D4366 を無効化...
  -> キー 66BD74A036D522F51DD70A3C7F2A16726521E06D を無効化...
  -> キー 81D7F8241DB38BC759C80FCE3A726C6170E80477 を無効化...
  -> キー E7210A59715F6940CF9A4E36A001876699AD6E84 を無効化...
==> 信用データベースを更新...
gpg: 次回の信用データベース検査は、2016-01-22です

# pacman-key --refresh-keys





 
2)firefox 立ち上がらない 
pacman -Syuしよう。
operaをいれておこう。 
 
 
 
これでも 
 ●●●●●●●●●●●●
 $ firefox 
XPCOMGlueLoad error for file /usr/lib/firefox/libxul.so:
libvpx.so.2: cannot open shared object file: No such file or directory
Couldn't load XPCOM.


のときは


# cd /usr/lib/
# ln -s libvpx.so.1.3.0 libvpx.so.2

 
 



2015年2月24日火曜日

teamviewer と rsync+ssh と ssh -Y  




1) 下の図は 自宅のtahr  から遠隔地のarch にはいりました。
teamviewer は vnc over sshと比べると 早い早い。
ssh -Yは ある特定のアプリしか立ち上がらなく、x-windows全体は無理です。

teamviewer は なんたって
 Easy to use remote desktop sharing / presentation and file transfer application that works  behind routers and firewalls.
の能力があります。
つまり 2つのPCでteamviewerをうごかしておれば ポートがひらいてなくとも 
firewallの向こうでもいいわけです。

(http://okwave.jp/qa/q6426998.htmlでは
TeamViewerがIPアドレスやファイアウォール(FW)を意識しなくて済むのは,
被操作側PCに相手が侵入するのではなく,
被操作側が自主的にインターネットに出て行って,
TeamViewerルーティングサーバ上でIDとパスワードを発行してもらい,
相手がやってくる (セッションの確立)のを同サーバ上で待つからです


 

2)ssh+rsync

sshdは 、インターネットに出て行って相手がやってくる のを待ってたりしません。
だから ファイアウォール越にsshを使うには、
teamviewerではいって そこからあらためてssh+rsync をします。

 rsync -a --delete -e ssh /home/t t@a.mydns.jp:/home/t/k
^CKilled by signal 2.
rsync error: unexplained error (code 255) at rsync.c(632) [sender=3.1.1]
rsync: [sender] write error: Broken pipe (32)

だった。
バカみたいな話だが、 両方のPCにrsyncをいれたら解決。



3)ssh -Y
遠隔地のPCでは aurのteamviewer10 がはいりません。
しかたなく windows用のTeamViewer_Setup_ja.exeをダウンロードして
wine TeamViewer_Setup_ja.exeをしますと、ひきづられてmono と geckoがはいり、teamviewer10のアイコンがでますが、たちあがりません。

遠隔地のarch のteamviewer9は、自宅のarchのteamviewer10には接続できません。

しょうがないので遠隔地では ssh -Y を使います。
つまり、  遠隔地でssh -Y t@a.mydns.jp です。


なお  /etc/ssh/sshd_config ですが

遠隔地のは $ cat /etc/ssh/sshd_config
AuthorizedKeysFile    .ssh/authorized_keys
ChallengeResponseAuthentication no
UsePAM yes
PrintMotd no # pam does that
UsePrivilegeSeparation sandbox        # Default for new installations.
Subsystem    sftp    /usr/lib/ssh/sftp-server
X11Forwarding yes


自宅のはcat /etc/ssh/sshd_config
Port 22
Protocol 2

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key

UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120

#PermitRootLogin yes

StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no

PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes



ssh -Y t@a.mydns.jpしたあと、midoriで
遠隔地のPCにmidoriが立ち上がってきます。



 
 
 
 
 
 
 















 





2015年1月7日水曜日

dice

cybergateで 追随するには



diceですが./diced | nkf -uwして日本語が見えるようにして
1番目に setupし
 
 
2番目に addて

[ オフライン ]
(0)No (1)Yes
番号>1

そしてから dicedを実行させるといいです。
詳細はネットで調べて下さい。

2014年12月28日日曜日

Windows8.1のフォルダを mount する。

これはまさに
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/a004mountcifs.html
そのもので

cat mount-windows81-common.bat

mount -t cifs //192.168.100.102/common /mnt81  -o username=user1

です。

もちろん windows81で ローカルアカウントuser1をつくってます。





dvdstyler

2014年12月23日火曜日

ssh -X 、起動時実行



p1<----------------------------------------------------p2
ssh server



SSHDサーバP1を
 ./comment-out.bat /etc/ssh/sshd_config

PermitRootLogin no
AuthorizedKeysFile    .ssh/authorized_keys
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
X11UseLocalhost no
  #こうしないとP2ではなくP1側でchromiunがたちあがる
PrintMotd no # pam does that
UsePrivilegeSeparation sandbox        # Default for new installations.
Subsystem    sftp    /usr/lib/ssh/sftp-server



とします。


それから インターネット越しに P2から
ssh -X  user-1@example.mydns.jp
して P1に入り、

export XMODIFIERS=@im=ibus
ibus-daemon &

そして
chromium
をすると 
p2の上でchromiumが立ち上がります。



起動時実行
cronieをいれて

root で crontab -e 
して

 EXTENSIONS
       These special time specification "nicknames" which replace the  5  ini‐
       tial time and date fields, and are prefixed with the '@' character, are
       supported:

       @reboot    :    Run once after reboot.
       @yearly    :    Run once a year,  ie.  "0 0 1 1 *". 1/1 0:0
       @annually  :    Run once a year,  ie.  "0 0 1 1 *".
       @monthly   :    Run once a month, ie.  "0 0 1 * *".   1 0:0
       @weekly    :    Run once a week,  ie.  "0 0 * * 0".   s 0:0
       @daily     :    Run once a day,   ie.  "0 0 * * *".     0:0
       @hourly    :    Run once an hour, ie.  "0 * * * *".       0
                                                m h d m

              minute         0-59
              hour           0-23
              day of month   1-31
              month          1-12 (or names, see below)
              day of week    0-7 (0 or 7 is Sunday, or use names)



@reboot /home/ttt/nginx.bat
するといいらしい。




arch コンソール で 日本語 ; arch backup

http://d.hatena.ne.jp/devm33/20120903/1346688956
に ほぼ準拠してます。


jfbterm-git ははいらないので
yaourt -S jfbterm-freebsd

それから
uim
bdf-unifont (いらないかも)
pcf-unifont
をいれます。


cat .uim
(define-key generic-on-key? '("<Shift> " "<Control> " "<Control>\\"))
(define-key generic-off-key? '("<Shift> " "<Control> " "<Control>\\"))


loginしたら
jfbterm -q -e uim-fep -u anthy
をします。

すると 日本語表示となります。
もう 文字化けしません。
ctrl + space で日本語入力ができます。

お手軽です。







https://sudopacman.wordpress.com/2014/12/02/backup-and-restore-arch-linux/
に準拠してます。


バックアップ
cd archのあるところ
tar  -czvpf  /バックアップ先/backup.tar.gz  --exclude=proc --exclude=sys --exclude=dev --exclude=tmp --exclude=XXXXX  --exclude=mnt   .

http://www.aboutdebian.com/tar-backup.htm

tar -zcvpf /backups/fullbackup.tar.gz --directory=/ 
--exclude=proc
--exclude=sys --exclude=dev/pts --exclude=backups .

Likewise, our untar-ing command becomes:


tar -zxvpf /fullbackup.tar.gz


レストア
mkdir /mnt/arch
$
sudo mount /dev/sda2 /mnt/arch  (arcをいれるところ)
$

Then let’s extract the tar file.

$ sudo tar -zxvpf /バックアップ先/data/backup.tar.gz -C /mnt/arch



Mount dev, proc and sys
Mount them into the target restoring point, since you need the machine relevant information from the session.

$ sudo cp /etc/resolve.conf /mnt/arch/etc
$ sudo mount -t proc none /mnt/arch/proc
$ sudo mount -t sysfs none /mnt/arch/sys
$ sudo mount -o bind /dev/ /mnt/arch/dev

Now already to go. Then change the root to the extracted backup.

$ sudo chroot /mnt/arch
$ source ~/.bashrc

Use the last command if you need to reload the environment parameters (such as environment variables).

2014年12月14日日曜日

apache digest 認証 ; nginx の basic 認証 と server block


http://www.atmarkit.co.jp/flinux/rensai/linuxtips/698apachebasic.html
ほぼこの通りです。


但し
# ls -l /srv/http/
合計 8
-rw-r--r-- 1 root root   28 12月 10 12:03 index.html
drwxr-xr-x 2 root root 4096 12月 10 13:09 member



# head /etc/httpd/conf/httpd.conf
<Directory "/srv/http/member">
    AuthType Basic
    AuthName "Secret Zone"
    AuthUserFile /etc/httpd/.htpasswd
    Require user secret
</Directory>


htpasswd  -c /etc/httpd/.htpasswd secret









cat httpd-on.bat 
sudo mount /dev/sda4 /HTTP
sudo ln -s /HTTP/htdocs/ /srv/http

sudo systemctl restart httpd.service
sudo systemctl restart sshd
sudo /home/tuyosi/nat.bat

echo '----------------------'
ps ax | grep sshd
ps ax | grep httpd
sudo iptables -L




なお
http://www.sotechsha.co.jp/sp/640/server_02.html
を参考にしてダイナミックDNSしてます。


ただし wifiなので グローバルアドレスを割り当ててもらう必要があり、
さらに Uroadaeroで ポートフォワーディングを設定しなければなりませんでした。

今まではNAPTされて グローバルアドレスはもらってませんでした。
ただし グローバルアドレスをもらうと 元のNAPTには戻りませんので リスクを負う覚悟がいります。
一番の危険はwifiルーターに入られて設定を勝手に変更されたり、
wwwサーバに入られたりです。 


intenet
|
|wireless
|
uroadaero wifiルーター
|
|wireless
|
arch linux(www server)



digest認証です。
http://shohei.yokoyama.ac/%E6%8A%80%E8%A1%93%E3%83%A1%E3%83%A2/%E7%99%BD%E9%BB%92%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BCmod_ssl%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E8%A8%98%E9%8C%B2#.E3.81.A4.E3.81.84.E3.81.A7.E3.81.AB.E3.83.80.E3.82.A4.E3.82.B8.E3.82.A7.E3.82.B9.E3.83.88.E8.AA.8D.E8.A8.BC.E3.82.82.E3.81.8B.E3.81.91.E3.82.8B

を参考にしました。
AuthUserFileをAuthDigestFileと書いてあるサイトもありますが、古い情報ですとの事

more /etc/httpd/conf/httpd.conf
<Directory "/srv/http/XXX">
  AuthType Digest
   AuthName "YYY"
   AuthDigestDomain /http_ssl/
   AuthUserFile /etc/httpd/.htdigest
   Require user zzz
</Directory>
中略

LoadModule auth_digest_module modules/mod_auth_digest.so #を外します。

htdigest -c /etc/httpd/.htdigest 'YYY' zzz

ですね。













あと 遠くはなれたところからこれにSSHで入ってメインテナンスをするのに
いらないプロセスがあると遅いので止めます。

 cat X-off.bat 


sudo kill `ps ax| grep xinit  | grep -v grep | cut -d ' ' -f 3`

sudo kill `ps ax| grep dhcpcd | grep -v grep | cut -d ' ' -f 3`

sudo kill `ps ax| grep ibus-daemon | grep -v grep | cut -d ' ' -f 3`

sudo kill `ps ax | grep 'chromium' | grep Sl | grep -v type | cut -d ' ' -f 2`




















nginX です デフォルトではchrootかかってない、危ない。

virtualhost(nginxでは server block と言います)  

basic 認証

apacheは ふるくなってます。
virtualhost として使うなら nginxの方がはるかに使いやすい。




# cat /mnt/home/etc/nginx/nginx.conf



############################

worker_processes  1;
events {
    worker_connections  1024;
}

#h>
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;


#---------------



 server {
        listen       80;
        server_name  localhost;
          root     /mnt-nginx/d1;
          index  index.html index.htm;
          auth_basic "Restricted";
          auth_basic_user_file /etc/nginx/1/.htpasswd;
        }
#  /mnt-nginx/1/.htpasswd ではダメです


#----------------------------------mydns
    server {
        listen       80;
        server_name  a.mydns.jp;
        root   /mnt-nginx/d0;
        index  index.html index.htm;
           }


#--------------------------------ddns
    server {
    listen       80;
    server_name  s.sun.ddns.vc;
    root     /mnt-nginx/d1;
    index  index.html index.htm;
    auth_basic "Restricted";                     
    auth_basic_user_file /etc/nginx/1/.htpasswd;   
         }


    server {
    listen       80;
    server_name  k.sun.ddns.vc;
    root     /mnt-nginx/d2;
    index  index.html index.htm;
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/2/.htpasswd;
          }


 server {
    listen       80;
    server_name  m.planex.ddns.vc;
      root     /mnt-nginx/d11;
      index  index.html index.htm;
        auth_basic "Restricted";
        auth_basic_user_file /etc/nginx/11/.htpasswd;
        }


#nita.luna.ddns.vc
 server {
    listen       80;
    server_name  n.luna.ddns.vc;
      root     /mnt-nginx/d12;
      index  index.html index.htm;
        auth_basic "Restricted";
        auth_basic_user_file /etc/nginx/12/.htpasswd;
        }

#h<
}