闲来无事,在自己电脑上用虚拟机的Ubutun总觉得不方便。所以,翻出了以前的上网本,安装个Ubuntu玩玩
问题: 上网本比较老,无法安装64bit Ubuntu
方法: 退而求其次。
通过用UltraISO在u盘已经刻录好了 Ubuntu 14.04 64bit,但是电脑提示说,由于cpu是386,不支持64位系统。
好吧,那就搞个32bit的吧,这个没办法。后来,在按了F11进入BIOS Boot时选择USB启动,但是电脑居然忽略了USB,根本就进不了我的USB启动。
后来网上搜,发现在UltraISO设置时,需要选择USB-ZIP,不能选择HDD,原因是部分旧电脑不支持HDD。(说的就是我的电脑,莫名中枪)
按照提示,选择USB-ZIP。刻录,安装。一切顺利。
安装
见上述。。
安装过程中,需要人工参与:选择时区、键盘映射类型、语言、主机名、默认账号密码(要有个初始的用户咯)。
建议:在安装过程中,不连接网络,不然他会边安装边下载很多东东,导致安装时间加长。
更新
sudo apt-get update
sudo apt-get upgrade
此刻要保证网络是通的哦。
安装vim
sudo apt-get install vim
安装ssh
安装
sudo apt-get ssh
查看是否安装好
sudo ps -e | grep ssh
如果成功:
2485 ? 00:00:00 sshd
如果失败:
是没有 sshd 显示的
配置ssh
sudo vi /etc/ssh/sshd_config
信息如下:(屏蔽掉红色部分,添加绿色部分)
liuh@CoreServer:~$ cat /etc/ssh/sshd_config
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
安装samba
sudo apt-get install samba
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libntdb1 python-ntdb
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
attr libaio1 python-dnspython samba-dsdb-modules samba-vfs-modules tdb-tools
Suggested packages:
bind9 bind9utils ldb-tools ntp smbldap-tools winbind
The following NEW packages will be installed:
attr libaio1 python-dnspython samba samba-dsdb-modules samba-vfs-modules
tdb-tools
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,516 kB of archives.
After this operation, 14.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]
安装好后:
liuh@CoreServer:~$ ps -e | grep smb
5007 ? 00:00:00 smbd
5048 ? 00:00:00 smbd
5093 ? 00:00:00 smbd
然后。
liuh@CoreServer:~$ sudo vi /etc/samba/smb.conf
在最后添加你要共享的目录,例如:
[liuh]
comment =liuh
path = /home/liuh/
browseable = yes
writable = yes
available = yes
public = yes
liuh@CoreServer:~$ sudo smbpasswd -a liuh
New SMB password:
Retype new SMB password:
Added user liuh.
然后,重启samba服务
liuh@CoreServer:~$ sudo service samba restart
最后,在PC上,映射Ubuntu的samba即可,如下图