لینوکس و شبکه

لینوکس و شبکه
طبقه بندی موضوعی
آخرین مطالب
  • ۹۹/۱۱/۱۳
    java

۳ مطلب با کلمه‌ی کلیدی «secure» ثبت شده است

۳۰
بهمن

برای راه اندازی وی پی ان از طریق terminal در لینوکس به روش زیر عمل مینماییم

modprobe nf_conntrack_pptp    # add pptp module to kernel
pppd call linuxconfig     # stablished Tunnel
route add default dev ppp0    #route all traffic to Tunnel

اسکریپت شده دستورات بالا:

#!/bin/bash
username=$1;
password=$2;
if [[ "$username" != "" && "$password" != "" ]]; then
echo "INSTALL STARTING ..."
# rpm -ivh pptp-1.7.2-22.el7.x86_64.rpm    #if is not install in server please install it
modprobe  nf_conntrack_pptp
echo "$username   PPTP    $password        *">/etc/ppp/pap-secrets
echo 'pty "pptp 10.10.10.10 --nolaunchpppd"    #10.10.10.10 Is Gateway's ip
name '$username'
remotename PPTP
#require-mppe-128
file /etc/ppp/options.pptp
ipparam linuxconfig'>/etc/ppp/peers/linuxconfig
echo 'lock
noauth
refuse-eap
refuse-chap
refuse-mschap
nobsdcomp
nodeflate'>/etc/ppp/options.pptp  #or comment refuse-pap line in tis file
pppd call linuxconfig
route add default dev ppp0
else
echo "please insert username password."
fi



نکته: یکی از dependency های اسکریپت بالا URL

دستورات بالا با دوفایل ارتباط دارد که این فایل‌ها وقتی بخواهیم بدون اسکریپت بالا پیکربندی کنیم به صورت زیر عمل خواهیم کرد.


vim /etc/ppp/peers/linuxconfig

pty "pptp 10.10.10.10 --nolaunchpppd" 
name USERNAME
remotename PPTP
#require-mppe-128
file /etc/ppp/options.pptp
ipparam linuxconfig


vim /etc/ppp/pap-secret

# Secrets for  authentication using PAP
# client server secret      IP addresses
username     PPTP    password     *

  • behrooz mohamadi nsasab
۰۷
فروردين
برخی دسترسی های خاص در لینوکس وجود دارند که در ادامه همین پست به آنها می‌پردازیم
$ touch 970107.txt
$ lsattr 970107.txt
--------------e---- 970107.txt
$ echo salam >> /tmp/970107.txt
$ cat  /tmp/970107.txt
salam
$ sudo chattr +i /tmp/970107.txt
$ lsattr 970107.txt
----i---------e---- 970107.txt
$ echo salam2 >> /tmp/970107.txt
bash: /tmp/970107.txt: Operation not permitted
$ sudo rm -rf  /tmp/970107.txt
rm: cannot remove '/tmp/970107.txt': Operation not permitted
$ sudo mv   /tmp/970107.txt  ~
mv: cannot move '/tmp/970107.txt' to '/home/behrooz/970107.txt': Operation not permitted
$ sudo chattr -i /tmp/970107.txt
$ lsattr /tmp/970107.txt
--------------e---- /tmp/970107.txt

  • behrooz mohamadi nsasab
۰۵
فروردين
CentOS:            sudo yum install git
Debian/Ubuntu: sudo apt-get install git
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
cd /opt/letsencrypt
sudo -H ./letsencrypt-auto certonly --standalone -d example.com -d www.example.com
نکته: برای هر دامنه ای که نیاز به داشتن ca است از سوییچ d استفاده شده و سپس نام آن درج شود
نکته: برای این که دستور بالا به درستی کار کند Nginx را پایین بیاورید.
-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: a

-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: n
در بالا لایسنس را می‌پذیریم:
سپس n  را وارد میکنیم
در ادامه اگر کار به درستی تمام شده باشد باید پیامی مشابه زیر نمایش شود(Congratulations):
IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/example.com/privkey.pem
   Your cert will expire on 2018-05-27. To obtain a new or tweaked
   version of this certificate in the future, simply run
   letsencrypt-auto again. To non-interactively renew *all* of your
   certificates, run "letsencrypt-auto renew"
 - If you like Certbot, please consider supporting our work by:
   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
نکته: certificate ها در مسیر زیر ذخیره می شوند:
sudo ls /etc/letsencrypt/live
با دستور زی رمسیر فایل و کلید certificate را مشاهده خواهید کرد:

./certbot-auto certificates
Found the following certs:
Certificate Name: example.com
Domains: example.com www.example.com
Expiry Date: 2018-05-27 20:49:02+00:00 (VALID: 89 days)
Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem

لینک های مفید: URL

 لینک مفید : URL







  • behrooz mohamadi nsasab