vim named.conf.local zone "MyDomain.it" IN { type master; file "MyDomain.it"; };
vim named.conf.options options { // If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113 // If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all-0's placeholder. // forwarders { // 0.0.0.0; // }; //======================================================================== // If BIND logs error messages about the root key being expired, // you will need to update your keys. See https://www.isc.org/bind-keys //======================================================================== directory "/var/cache/bind"; listen-on port 53 {localhost;10.0.20.0/24;192.168.40.0/24; }; allow-query {localhost;10.0.20.0/24;192.168.40.0/24;}; recursion yes; forwarders {192.168.100.12; }; dnssec-validation auto; auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; };
vim /var/cache/bind/domain.ir $TTL 86400 @ IN SOA ns1.MyDomain.it. root.MyDomain.it( 20191214 ;Serial 3600 ;Refresh 900 ;Retry 604800 ;Expired 86400 ;Minimum TTL ) ;name servers - NS records IN NS ns1.MyDomain.it. IN A 192.168.40.40 IN MX 10 mail.MyDomain.it. ;name servers - A records ns1.MyDomain.it. IN A 192.168.40.40 dns.MyDomain.it. IN A 192.168.40.40 root.MyDomain.it. IN A 192.168.40.40 MyDomain.it. IN A 192.168.40.40 chat.MyDomain.it. IN A 192.168.40.41 mail.MyDomain.it. IN A 192.168.40.42 email.MyDomain.it. IN A 192.168.40.42 pop3.MyDomain.it. IN A 192.168.40.42 smtp.MyDomain.it. IN A 192.168.40.42 imap.MyDomain.it. IN A 192.168.40.42 behrooz.MyDomain.it. IN A 192.168.40.48
# rndc querylog on
${parameter:=word}:
If parameter is unset or null, the expansion of word is assigned to parameter.
The value of parameter is then substituted.
Positional parameters and special parameters may not be assigned to in this way.
${var:-value}:
if ${var} is set and not null, or value otherwise.
The ${var-value} construct is similar, but checks only that the variable is set.
${var:=value} and ${var=value}:
if var is unset (and also set, but null for the := form).
${var:?message}:
display message to stderr and then exit if var is unset or null.
This should generally not be used within ebuilds as it does not use the die mechanism.
There is a ${var?message} form too.
${var:+value}:
if var is set and not null, or a blank string otherwise.
There is a ${var+value} form.
vboxmanage list hostinfo
vboxmanage list vms
vboxmanage list vms --long
vboxmanage list runningvms
vboxmanage list runningvms --long
vboxmanage showvminfo {UUID}
vboxheadless --startvm {UUID}
vboxmanage controlvm {UUID} savestate
vboxmanage controlvm {UUID} acpipowerbutton
tar:
archive: tar -cvf File.tar /directory
Extract: tar xf FileName.tar
Tar.gz:
Archive: tar czvf name.tar.gz files
Extract: tar xzvf name.tar.gz
tar.bz2:
Archive: tar -cvjSf folder.tar.bz2 folder
Extract: tar xjf File.tar.bz2
bz2:
Archive: bzip2 -z filename
[or] Archive: bzip2 filename
Extract: bunzip2 FileName.bunzip2
[or] Extract: bzip2 -d filename.bz2
rar:
archive:
Extract: unrar e FileName.rar
gz:
Archive: gzip file
Extract: gzip -d file.gz
Extract: gunzip FileName.gz
zip:
archive: zip file.zip file
archive: zip -r Folder.zip folder
Extract: unzip File.zip
7zip:
Archive: 7z a File.7z File
Extract: 7z e File.7z
یک تجربه: در دبیان ۹ برای اینکه firmware کارت شبکه یو اس بی رو بشناسانیم از روش زیر استفاده میکنیم
add to /etc/apt/source.list
deb http://ftp.fr.debian.org/debian jessie main contrib non-free
deb http://httpredir.debian.org/debian/ stretch main contrib non-free
sudo apt-get install debian-reference
apt-get update && apt-get install firmware-iwlwifi
sudo apt-get update && apt-get install firmware-iwlwifi
sudo apt-get update && sudo apt-get install firmware-iwlwifi
sudo apt-get install modplug-tools
sudo apt-get install modprobe
sudo apt-get install modprob
sudo apt-get install kmod
sudo apt-get install wicd
sudo apt-get install firmware-realtek
sudo apt-get install firmware-iwlwifi
sudo apt-get install firmware-linux
sudo apt-get install amd64-microcode firmware-linux-nonfree firmware-misc-nonfree
select
case
when b.table_name is null then
'unindexed'
else
'indexed'
end as status,
a.table_name as table_name,
a.constraint_name as fk_name,
a.fk_columns as fk_columns,
b.index_name as index_name,
b.index_columns as index_columns
from
(
select
a.table_name,
a.constraint_name,
listagg(a.column_name, ',') within
group (order by a.position) fk_columns
from
dba_cons_columns a,
dba_constraints b
where
a.constraint_name = b.constraint_name
and
b.constraint_type = 'R'
and
a.owner = '&&schema_owner'
and
a.owner = b.owner
group by
a.table_name,
a.constraint_name
) a
,(
select
table_name,
index_name,
listagg(c.column_name, ',') within
group (order by c.column_position) index_columns
from
dba_ind_columns c
where
c.index_owner = '&&schema_owner'
group by
table_name,
index_name
) b
where
a.table_name = b.table_name(+)
and
b.index_columns(+) like a.fk_columns || '%'
order by
1 desc, 2;
جستجو در عبارت است نظیر grep در لینوکس
ipconfig | findstr IP
تمام اطلاعات از کارت شبکه:
ipconfig /all
DNS های لوکال cache شده در سیستم
ipconfig /displaydns
ipconfig /flushdns
systeminfo
tasklist
بستن یک برنامه بر اساس پروسس آی دی
taskkill /PID NUMBER
نمایش متن یک فایل متنی
type FILE.txt
وضعیت و اطلاعات سوکتها و پورتها و کانکشنهای سیسیتم را نشان میدهد
netstat -a
برای start ویا stop کردن سرویسها از دستور زیر استفاده میشود:
net start SERVICE
net stop SERVICE
برای افزودن یک درارو شبکهای ویا حذف آن از دستور زیر استفاده میشود
net use m: \myserversharename
net use m: \myserversharename /delete
نکته:دستور net بسیار کارهای دیگر نیز میتواتند انجام دهد که شرح آن را در help آن مشاهده نمایید.
برای اینکه ببینید dns پیش فرض شما چه میباشد از دستور nslookup استفاده نمایید
nslookup
برای تغییر dns از پیشفرض به یک سرور دیگر ابتدا دستور nslookup را زده و سپس دستور set ds وارد کرده و اینتر را بزنید و سپس آدرس ip دی ان اس سرور مورد نظر را وارد نمایید.
nslookup
set ds
8.8.8.8
nslookup NAME 8.8.8.8.
ترتیب خوانده شدن فایل های کانفیگی در دبیان 9:
200430-155851-Profile:begin (اجرا در اول)
200430-155851-profile:End (اجرا در دومین مرحله)
200430-155915-bashrc:begin (اجرا در سومین مرحله)
200430-155915-bash_alias:begin (اجرا در چهارمین مرحله)
200430-155915-bash_alias:End (اجرا در پنجمین مرحله)
200430-155915-bashrc:end (اجرا در ششمین مرحله)
/proc/meminfo(KB) | free -k | Status | |
MemTotal | 4040208 | 4040208 | Equal |
MemFree | 5032 | 5016 | Equal |
MemAvailable | 1582984 | 1582968 | Equal |
used | 2116340 | Total – (free + cache + buffer) | |
Buffers | 94508 | 1405852 | Equal |
Cached | 12532 | ||
SwapTotal | 9867260 | 9867260 | Equal |
SwapFree | 9867260 | 9867260 | Equal |
swap used | 0 | ||
Shmem | 91388 | 91388 | Equal |
--------------e---- 970107.txt
$ echo salam >> /tmp/970107.txt salam
$ sudo chattr +i /tmp/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
--------------e---- /tmp/970107.txt
alias ssh_LfreeNas='sshpass -p PASSWORD ssh USER@IP' #dependency: sshpass
دیوایس های متصل به سیستم
alias B_mount="mount | column -t"
پاک کردن با تایید اگر بیش از سه فایل داریم پاک میکنیم(do not delete / or prompt if deleting more than 3 files at a time)
alias rm='rm -I --preserve-root'
alias chown='chown --preserve-root' # Parenting changing perms on /
alias chmod='chmod --preserve-root' # Parenting changing perms on /
alias chgrp='chgrp --preserve-root' # Parenting changing perms on /
بازگشت به مسیر بالاتر:
alias ='cd '
alias .='cd /'
alias ='cd //'
جستجوی یک پردازه در لبست تمامی پردازهها (نیاز به آرگومان ورودی که آن را جستجو نماید)
alias ps?="ps aux | grep"
تولید پسورد رندم:
alias B_genPasswd="strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo"
نمایش صفحه نمایش بصورت جالب(funny)
alias B_busy="cat /dev/urandom | hexdump -C | grep \"ca fe\""
مشاهده لاگ
alias B_logDmesg='sudo dmesg -Tx --follow'
alias B_logSyslog='sudo tail -n 25 -f /var/log/syslog'
گرفتن تایید:
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
الیاس های رایج:
alias ls="ls --color=auto"
alias ll="ls --color -al"
alias grep='grep --color=auto'
چند تابع کاربردی که میتوان بعنوان الیاس از آن استفاده کرد:
mcd() { mkdir -p "$1"; cd "$1";}
cls() { cd "$1"; ls;}
B_backup () { _time=$(date +%Y%m%d-%H%M%S) ; cp "$1"{,.bak_$_time}; }
نکته : alias های زیر از سایت URL برگرفته شده است و هیچ ضمانتی برای اجرای آن نیست:
extract() { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xjf $1 ;; *.tar.gz) tar xzf $1 ;; *.bz2) bunzip2 $1 ;; *.rar) unrar e $1 ;; *.gz) gunzip $1 ;; *.tar) tar xf $1 ;; *.tbz2) tar xjf $1 ;; *.tgz) tar xzf $1 ;; *.zip) unzip $1 ;; *.Z) uncompress $1 ;; *.7z) 7z x $1 ;; *) echo "'$1' cannot be extracted via extract()" ;; esac else echo "'$1' is not a valid file" fi } #System info alias tree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'" sbs(){ du -b --max-depth 1 | sort -nr | perl -pe 's{([0-9]+)}{sprintf "%.1f%s", $1>=2**30? ($1/2**30, "G"): $1>=2**20? ($1/2**20, "M"): $1>=2**10? ($1/2**10, "K"): ($1, "")}e';} alias intercept="sudo strace -ff -e trace=write -e write=1,2 -p" alias meminfo='free -m -l -t' alias volume="amixer get Master | sed '1,4 d' | cut -d [ -f 2 | cut -d ] -f 1" #Network alias websiteget="wget --random-wait -r -p -e robots=off -U mozilla" alias listen="lsof -P -i -n" alias port='netstat -tulanp' gmail() { curl -u "$1" --silent "https://mail.google.com/mail/feed/atom" | sed -e 's/<\/fullcount.*/\n/' | sed -e 's/.*fullcount>//'} alias ipinfo="curl ifconfig.me && curl ifconfig.me/host" getlocation() { lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\';} #Funny kernelgraph() { lsmod | perl -e 'print "digraph \"lsmod\" {";<>;while(<>){@_=split/\s+/; print "\"$_[0]\" -> \"$_\"\n" for split/,/,$_[3]}print "}"' | dot -Tpng | display -;}
1-cat /proc/cpuinfo
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 69 model name : Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz stepping : 1 microcode : 0x1c cpu MHz : 1700.062 cache size : 3072 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts bugs : bogomips : 4788.92 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management:
2- lscpu
Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 69 Model name: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz Stepping: 1 CPU MHz: 1303.687 CPU max MHz: 2700.0000 CPU min MHz: 800.0000 BogoMIPS: 4788.92 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 3072K NUMA node0 CPU(s): 0-3 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
3- cpuid
CPU 0: vendor_id = "GenuineIntel" version information (1/eax): processor type = primary processor (0) family = Intel Pentium Pro/II/III/Celeron/Core/Core 2/Atom, AMD Athlon/Duron, Cyrix M2, VIA C3 (6) model = 0x5 (5) stepping id = 0x1 (1) extended family = 0x0 (0) extended model = 0x4 (4) (simple synth) = Intel Mobile Core i3-4000Y / Mobile Core i5-4000Y / Mobile Core i7-4000Y / Mobile Pentium 3500U/3600U/3500Y / Mobile Celeron 2900U (Mobile U/Y) (Haswell), 22nm miscellaneous (1/ebx): process local APIC physical ID = 0x0 (0) cpu count = 0x10 (16) CLFLUSH line size = 0x8 (8) brand index = 0x0 (0) brand id = 0x00 (0): unknown feature information (1/edx): x87 FPU on chip = true virtual-8086 mode enhancement = true debugging extensions = true page size extensions = true time stamp counter = true RDMSR and WRMSR support = true physical address extensions = true
4- sudo dmidecode --type processor
# dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.7 present. Handle 0x0004, DMI type 4, 42 bytes Processor Information Socket Designation: U3E1 Type: Central Processor Family: Core i5 Manufacturer: Intel(R) Corporation ID: 51 06 04 00 FF FB EB BF Signature: Type 0, Family 6, Model 69, Stepping 1 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) .
5- inxi -C
CPU: Dual core Intel Core i5-4210U (-HT-MCP-) cache: 3072 KB clock speeds: max: 2700 MHz 1: 1958 MHz 2: 1993 MHz 3: 1775 MHz 4: 1714 MHz
6- sudo lshw -C CPU
*-cpu description: CPU product: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz vendor: Intel Corp. physical id: 4 bus info: cpu@0 version: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz serial: To Be Filled By O.E.M. slot: U3E1 size: 2626MHz capacity: 2700MHz width: 64 bits clock: 100MHz capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts cpufreq configuration: cores=2 enabledcores=2 threads=4
7- hardinfo
8- hwinfo --cpu
01: None 00.0: 10103 CPU [Created at cpu.460] Unique ID: rdCR.j8NaKXDZtZ6 Hardware Class: cpu Arch: X86-64 Vendor: "GenuineIntel" Model: 6.69.1 "Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz" Features: fpu,vme,de,pse,tsc,msr,pae,mce,cx8,apic,sep,mtrr,pge,mca,cmov,pat,pse36,clflush,dts,acpi,mmx,fxsr,sse,sse2,ss,ht,tm,pbe,syscall,nx,pdpe1gb,rdtscp,lm,constant_tsc,arch_perfmon,pebs,bts,rep_good,nopl,xtopology,nonstop_tsc,aperfmperf,eagerfpu,pni,pclmulqdq,dtes64,monitor,ds_cpl,vmx,est,tm2,ssse3,sdbg,fma,cx16,xtpr,pdcm,pcid,sse4_1,sse4_2,movbe,popcnt,tsc_deadline_timer,aes,xsave,avx,f16c,rdrand,lahf_lm,abm,epb,tpr_shadow,vnmi,flexpriority,ept,vpid,fsgsbase,tsc_adjust,bmi1,avx2,smep,bmi2,erms,invpcid,xsaveopt,dtherm,ida,arat,pln,pts Clock: 2080 MHz BogoMips: 4788.92 Cache: 3072 kb Units/Processor: 16 Config Status: cfg=new, avail=yes, need=no, active=unknown
9-nproc
10-lspci
1- sudo apt-get install mate-desktop-environment
2- sudo apt-get install vnc4server
3- vncserver
4- vncserver -kill :1
5- vim ~/.vnc/xstartup
change:
#!/bin/bash
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
#. /etc/X11/xinit/xinitrc
/usr/bin/mate-session
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
**only debain 9
6- sudo vim /etc/vnc.conf
add:
$localhost = "no";
7- vncserver
directory_to_share client(share_option1,.,share_optionN)7- sudo exportfs -a
اگر در ویندوز پسورد خود را فراموش کردید برای ورود به سیستم میتوان به روش زیر عمل کرد:
برای ارسال ایمیل از از طریق ترمینال باید با دستور زیر بسته های ذیل را نصب نمایید:
sudo apt-get install ssmtp mailutils
سپس فایل زیر را باز کرده ومحتویات آن را مطابق زیزر تغییر دهید:
cat /etc/ssmtp/ssmtp.conf |grep -v -E ^#|grep .
root=postmaster
mailhub=smtp.gmail.com:587
hostname=oldpc
UseTLS=Yes
UseSTARTTLS=Yes
AuthUser=alertbehrooz@gmail.com
AuthPass=*******
FromLineOverride=YES
بهترین راه خاموش کردن سرورهای لینوکس است، زیرا به تمام کاربران Login شده سرور اطلاع رسانی مینماید (ارسال و نمایش پیغام)
همچنین از Login کاربر جدید جلوگیری به عمل آورده و سیگنالی به init ارسال مینماید تا Run Level تغییر نماید و پس از آن سیگنال دیگری ( سیگنالSIGTERM ) به تمامی Process های Run شده روی سرور ارسال مینماید که توسط آن مهلت چند ثانیه ای ذخیره اطلاعات Save نشده و آماده سازی برایkill شدن به پردازش ها میدهد
در نهایت پس از گذشت مدت زمان مهلت داده شده، در صورتی که هنوز پردازشی باقی مانده باشند، سیگنال kill شدن بصورت Force به آن ارسال میشود (سیگنال SIGKILL ) و در این حالت سیستم خاموش خواهد شد.
Switch ها:
خاموش شدن سیستم بعد از وقفه کوتاه
# shutdown
تغییر حالت Run Level به شماره 0 (shutdown ) بعد از وقفه کوتاه
# shutdown -h
تغییر حالت Run Level به شماره 6 (Restart ) بعد از وقفه کوتاه
# shutdown –r
تغییر حالت Run Level به شماره 6 (Restart ) در لحظه فعلی (هم اکنون)
# shutdown –r now
تغییر حالت Run Level به شماره 6 (Restart )بعد از وقفه دو دقیقه
# shutdown –r 2
تغییر حالت Run Level به شماره 6 (Restart )بعد از وقفه دو دقیقه همراه با نمایش پیغام (متنComment برای تمامی کاربران Broadcast می گردد.)
# shutdown –r 2 Comment”
تغییر حالت Run Level به شماره 6 (Restart )دقیقا در زمان :23
# shutdown –r :23
تغییر حالت Run Level به شماره 6 (Restart )بعد از وقفه 9 ثانیه
# shutdown –r -t 9
تغییر حالت Run Level به شماره 6 (Restart )بعد از وقفه 15 دقیقه
# shutdown -r +15
متوقف نمودن (cancel ) پروسه shutdown ، درصورت تنظیم موعد shutdown آنرا کنسل میکند
# shutdown –c
سایر دستورها
تغییر Run Level به شماره شش(restart نمودن سیستم عامل)
# reboot
تغییر Run Level به شماره صفر(خاموش نمودن سیستم عامل)
# halt
همچنین
# poweroff
خروج از وضعیت Login سیستم و بازگشت به صفحه (خط)Login جهت ورود مجدد
# logout
در صفحه ای که گراب ظاهر شده است دکمه e (به معنی رفتن به محیط ادیت و تنظیمات گراب) را بزنید:عبارت زیر را
init=/boot/bash
به انتهای خطی که با عبارت زیر شروع میشود بیافزایید:
linux /boot/vmlinuz . . .
و سپس دکمه های ctrl+X رابزنید:
مشاهده خواهید کرد که سل بایلا آمده است ولی با این تفاوت که FileSystem از نوع readoly است !
برای خارج شدن سیستم عامل از readOnly دستور زیر را بزنید:
mount -rw -o remount /
حال سیستم عامل حالت rw داشته و میتوان پسورد را تغییر داد (یوزر فعلی ترمینال بالا آمده ، بوزر روت است)
برای تغییر پسورد دستورزیر را وارد نمایید:
passwd root
گاهی پیش میآید که یک یوزر بنا بر نیاز، دستور را با مالکیت یوزر خود اجرا نماید.
در این صورت باید با یکی از روش های زیر عمل نماید:
۱− باید در داخل یوزر خود لاگین نموده و از دستور زیر برای زمان گذاری اقدام نماید
crontab -e
۲− فایل زیر را با یک ادیتور باز کرده
vim /etc/crontab
و با فرمت زیر
m h dom mon dow USER command and arguments
برای زمان گذاری اقدام نماید
۳− در مسیر زیر
/etc/cron.d/
یک فایل ایجاد کرده و با فرمت
m h dom mon dow USER command and arguments
برای زمان گذاری اقدام نماید
۴−
درباره این سایت