Javaͨ¹ýSamba·þÎñ²Ù×÷Linux¹²ÏíÎļþ
Ê×ÏÈÔÚLinuxÉÏ´´½¨Ò»¸ö¹²ÏíÎļþ¼Ð
mkdir /home/user/share
ÓÃrootÓû§Æô¶¯samba·þÎñ
service smb start
ÐÞ¸Äsmb.confÎļþ
sudo gedit /etc/samba/smb.conf »òÕß vi /etc/samba/smb.conf
[share]
path = /home/user/share
...
writable = yes
´´½¨¹²ÏíÓû§²¢ÉèÖÃÃÜÂë
sudo useradd smbusr
sudo smbpasswd -a smbusr
ʹÓÃÃüÁî sudo smbpasswd -x ɾ³ýÓû§
ÖØÆôsamba·þÎñ
service smb restart
²âÊÔ
ÔÚwindowsÖÐÊäÈë\\192.168.0.94£¬²¢ÊäÈëÓû§ÃûÃÜÂësmbusr/***,¿´Äܲ»ÄÜ·ÃÎʵ½¹²ÏíÎļþ¼Ð¡£Èç¹û¿ÉÒԵĻ°¿½±´Ò»·Ý±¾µØtxtÎļþµ½´ËĿ¼£¬²¢ÔÚlinuxÖв鿴´ËÎļþÊÇ·ñ´æÔÚ£¬Èç¹ûÓÃviÄܹ»´ò¿ªÎļþÎļþ²¢Õý³£²é¿´ÆäÄÚÈÝ£¬congruatulations!
ÓÃjcifs²âÊÔÎļþ²Ù×÷
È¥ÏÂ
ÔØÊʵ±°æ±¾µÄjcifs£¬½«jcifs-1.3.14.jar¼ÓÈëµ½ÏîÄ¿¹¤³ÌÖС£Ð´¸ö²âÊÔÀ๲ÏíÎļþ²Ù×÷£º
public static void main(String[] args) {
FileInputStream fis = null;
SmbFileOutputStream sfos = null;
try {
fis = new FileInputStream(new File("c:/source.txt"));
sfos = new SmbFileOutputStream(new SmbFile("smb://smbusr:smbusr@192.168.1.94/smbusr/dest.txt"));
byte [] buffer = new byte[1024];
int c = 0;
while ((c = fis.read(buffer)) != -1) {
sfos.write(buffer);
}
} catch (SmbException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
finally {
try {
fis.close();
sfos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Ïà¹ØÎĵµ£º
×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......
×òÌìÓиöÅóÓÑÎÊÎÒ£¬Ñ§µÃ»á²»,°³ËµÑ§µÄ»á£¡
ºóÀ´ËûÓÖÎÊÎÒ£¬ËûÈç¹ûѧµÄ»°£¬Ñ§µÄ»áѧ²»»á£¬°³ËµÖ»Òª²»±¿µ°£¬°ÑÐÄ˼·ÅÔÚjavaÉÏ£¬¾ÍÒ»¶¨Ñ§µÄ»á£¡
ʱ¼äÒ»Ö±¹ýµÄ¶¼ºÜ¿ì£¬Ã¿¸öÈËÄÜ°ÑÎÕµÄÒ²Ö»ÓнñÌ죬ËùÒÔ¼´Ê¹À§ÄÑÔٶֻ࣬ÓдËʱ´Ë¿Ì×Ô¼ºÔÚ²»Í£µÄŬÁ¦¡£
ÄÄÅÂÏñÎÏÅ£Ò»ÑùµÄÇ°½ø£¬Ò²Ò»¶¨Óгɹ¦µÄÒ»Ì죬¾ÍÅÂ×Ô¼º·ÅÆú£¬ÅÂ×Ô¼ºÃ»ÓÐÐÅÐÄ£ ......
1¡¢ÏÂÔØjdk£¬¿ÉÒÔÖ±½ÓÔÚRHÉÏÏÂÔØ£¬Ò²¿ÉÒÔÔÚ±¾»úÏÂÔØ£¬È»ºóͨ¹ýpsftp´«ÉÏÈ¥£¨jdk-6u20-linux-i586-rpm.bin£©
2¡¢ÓÃputtyÁ¬½Ólinux
3¡¢Ö´ÐÐjdk-6u20-linux-i586-rpm.bin ûÕÒµ½
4¡¢Ö´ÐÐ./jdk-6u20-linux-i586-rpm.bin ÕÒµ½£¬µ«Ã»ÓÐȨÏÞ
5¡¢chmod 775 jdk-6u20-linux-i586-rpm.bin ¸ÄȨÏÞ
6¡¢Ö´ÐÐ./jdk-6u20-linux-i ......
ÔÚlinuxÖУ¬¿ÚÁîÎļþÔÚ/etc/passwdÖУ¬ÔçÆÚµÄÕâ¸öÎļþÖ±½Ó´æ·Å¼ÓÃܺóµÄÃÜÂ룬ǰÁ½Î»ÊÇ"ÑÎ"Öµ£¬ÊÇÒ»¸öËæ»úÊý£¬ºóÃæ¸úµÄÊǼÓÃܵÄÃÜÂ롣ΪÁË°²È«£¬ÏÖÔÚµÄlinux¶¼ÌṩÁË /etc/shadowÕâ¸öÓ°×ÓÎļþ£¬ÃÜÂë·ÅÔÚÕâ¸öÎļþÀïÃ棬²¢ÇÒÊÇÖ»ÓÐroot¿É¶ÁµÄ¡£
ÏÂÃæÀ´·ÖÎöÒ»ÏÂ/etc/passwdÎļþ£¬ËûµÄÿ¸öÌõÄ¿Ó ......
linux»ù´¡ÖªÊ¶
General Public Licence GPL
GNU ÏîÄ¿µÄc¿â£¬gcc£¬Emacs£¬bashµÈÒÆÖ²µ½linuxÄÚºË
linux°æ±¾ÓУºlinux BSD unix   ......