Linux Service Admin

[ SSH Without Password ]

SSH Server Config

/etc/ssh/sshd_config

...
GSSAPIAuthentication no
UseDNS no
...

SSH Client Config

/etc/ssh/ssh_config

..
GSSAPIAuthentication no
...

SSH Debug

eric@eric-pc:/etc/ssh$ ssh -v root@192.168.1.185

SSH Without Password

* Scenario: A -> ssh -> B
* A:~$ ssh-keygen -t rsa -P ''
* add A's pub key (.ssh/id_ras.pub in machine A) to B's ~/.ssh/authorized_keys
* B:~$ chmod 600 ~/.ssh/authorized_keys; chmod 700 ~/.ssh

[ vsftp ]

* apt-get install vsftpd

* useradd -d /opt/album/xile/mvideo/new lealbum

* passwd lealbum

* edit /etc/passwd

lealbum:x:1000:1000::/opt/album/xile/mvideo/new:/usr/sbin/nologin

* edit /etc/pam.d/vsftpd

# auth  required        pam_shells.so

* edit /etc/ftpusers: make sure the user (lealbum) is NOT in the list.

* cp /etc/vsfptd.conf /etc/vsfptd.conf.bak

* edit /etc/vsftpd.conf

listen=YES
local_enable=YES
write_enable=YES
local_umask=022
use_localtime=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
allow_writeable_chroot=YES

* service vsftpd restart

 

posted @ 2016-07-26 22:26  Eric.YAO  阅读(166)  评论(0)    收藏  举报