How to install SSH server on ubantu
SUSE repos
suse stable
http://download.opensuse.org/distribution/openSUSE-stable/repo/non-oss/
http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/
suse leap
http://download.opensuse.org/distribution/leap/15.3/repo/non-oss/
http://download.opensuse.org/distribution/leap/15.3/repo/oss/
M17N
http://download.opensuse.org/repositories/M17N/ (multi language)
http://download.opensuse.org/repositories/M17N/openSUSE_Leap_15.3/ (tools for 15.3)
???
https://opensuse-guide.ustclug.org/repositories.php
Chrome
http://dl.google.com/linux/chrome/rpm/stable/x86_64 chrome
https://dl.google.com/linux/chrome/rpm/stable/x86_64
User guide
1. https://opensuse-guide.ustclug.org/index.php
2. https://doc.opensuse.org/
3. https://www.cnblogs.com/xiangzi888/archive/2012/03/08/2385993.html
4. https://documentation.suse.com/zh-cn/sles/15-SP3/html/SLES-all/cha-gui-desktop.html 中文版 Display 设置
sudo zypper ar http://download.opensuse.org/distribution/openSUSE-stable/repo/non-oss/ non-oss
sudo zypper ar http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/ oss
sudo zypper ar http://download.opensuse.org/distribution/leap/15.3/repo/non-oss/ non-oss-15.3
sudo zypper ar http://download.opensuse.org/distribution/leap/15.3/repo/oss/ oss-15.3
sudo zypper ar http://download.opensuse.org/repositories/M17N/openSUSE_Leap_15.3/ M17N
sudo zypper ar https://dl.google.com/linux/chrome/rpm/stable/x86_64 Chrome
wget https://dl.google.com/linux/linux_signing_key.pub
sudo rpm --import linux_signing_key.pub
sudo zypper addrepo http://http.download.nvidia.com/opensuse/leap/15.3/x86_64/ NVIDIA
GNOME add in https://extensions.gnome.org/`
Install different OS components
1. Open Yast -> software management
2. At tab Configuration -> Repositories -> select the repo
3. Then select Patterns / Packages, all supported features will be selected.
-
安装Dash to DOCK /.Dash to Panel
5. Install flameshot, tool to capture screen, like snipaste # zypper in flameshot
6. set short cut for flameshot
WIN + S, Set Keyboard shortcuts
name: flameshot
command: flameshot gui
Shortcut: press a button
8. Dash to Panel https://extensions.gnome.org/extension/1160/dash-to-panel/
修改计算机名字
临时设置hostname主机名:
hostname <SERVER_NAME>
这里的'-v'主要是显示版本的.如果使用了'-v'的话,输出的结果大概是这样:
server1~# hostname -v computer2
Setting hostname to `computer2'
server1~#
退出终端,重新登陆终端,你就能看到主机名更改了
不过有的发行系统中这种方法是不能永久生效的.
**永久设置hostname主机名: **
编辑/etc/HOSTNAME
*# vi /etc/HOSTNAME *
或
# echo server2.mycompany > /etc/HOSTNAME
这样就可以永久设置了,重启电脑
使用YAST工具修改hostname主机名
打开YAST控制中心 control center.
*#yast *然后点到网络设置 --> DNS和Hostname.
然后主机名和网速设置窗口就会打开.
在hostname一栏,根据自己的需要修改主机名即可,然后重启电脑
查看服务器详细信息:
hostname - 会显示主机名
domainname - 显示/设置电脑的 NIS/YP域名
dnsdomainname - 显示电脑的DNS域名
设置IP
说明:ip:172.18.4.107 子网掩码:255.255.255.0 网关:172.18.4.254 dns:172.18.0.6
1、设置ip地址
vi /etc/sysconfig/network/ifcfg-eth0 #编辑配置文件
BOOTPROTO='static' #静态IP:
BROADCAST='172.18.4.255' #广播地址
IPADDR='172.18.4.107' #IP地址
NETMASK='255.255.255.0' #子网掩码
NETWORK='172.18.4.0' #网络地址
STARTMODE='auto' #开机启动网络
2、设置网关
vi /etc/sysconfig/network/routes #编辑文件
default 172.18.4.254
3、设置dns
vi /etc/resolv.conf #编辑文件
nameserver 172.18.0.6
rcnetwork restart #重启网络
service network restart #重启网络
/etc/init.d/network restart #重启网络
查看gate 选项: ip route
IP 分配
T5820 on top -1
IP: 10.189.131.35 / 255.255.255.0 / 10.189.131.1
User: sdc
Passwd: geMRint@adw2
T5820 on top -2 (ethernet port fail)
IP: 10.189.131.xx / 255.255.255.0 / 10.189.131.1
User: sdc
Passwd: geMRint@adw2
T5820 on top -3 (for Bali)
IP: 10.189.131.36 / 255.255.255.0 / 10.189.131.1
User: sdc
Passwd: geMRint@adw2
Dell Box -1 (P3240 SLE 15.3)
IP: 10.189.131.38 / 255.255.255.0 / 10.189.131.1
User: tester
Passwd: 1
FTP Server setup
$zypper in vsftpd #Install svftp
edit /etc/vsftpd.conf
$systemctl start vsftpd #start ftp service
$systemctl stop vsftpd #stop ftp
$ systemctl status vsftpd #get status of ftp
ftp命令 测试FTP 是否可用
$ftp 192.168.1.14
使用格式:ftp [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [computer]
-v:禁止显示远程服务器响应信息
PS C:\Users\212597558> sftp tester@192.168.1.4
Password:
Connected to 192.168.1.4.
sftp> ls
Desktop Documents Downloads Music Pictures Public Templates Videos bin
public_html
sftp> help
-n:禁止自动登录
-i:多文件传输过程中关闭交互提示
-d:启用调试,显示所有客户端与服务器端传递的命令
-g:禁用文件名通配符,允许在本地文件和路径名中使用
实例:ftp 122.122.122.122 2222
输入用户名、密码,即可完成登录。
2.目录操作
FTP命令可以列出、移动、创建文件夹。
ls -- 打印目录列表
!ls -- 查看本地目录
cd -- 改变目录
mkdir -- 创建文件夹
3.使用FTP下载文件
在下载一个文件之前,首先需要使用lcd命令设定本地接收目录位置。
lcd -- 指定下载目录
get file.txt [file_new.txt] -- 下载文件 支持更改名字
mget *.txt -- 使用mget + 通配符下载多个文件
4.使用FTP上传文件
put file.txt [file_new.txt] -- 上传文件 支持更改名字
put /home/data/cwh/file.txt -- 绝对路径
mput *.txt -- 上传多个文件
5.关闭FTP连接
完成FTP工作后,为了安全起见需要关闭连接。有3个命令可以关闭连接:
bye -- 关闭连接
exit -- 关闭连接
quit -- 关闭连接
close -- 关闭连接
6.其他命令
? -- 查询ftp命令
help -- 查询ftp命令
open [ftp server name] -- 和指定的远程Linux FTP服务器连接
user [user name] [password] -- 使用指定远程Linux FTP服务器的用户登录
pwd -- 显示当前路径
ls -- 列出目录和文件
dir -- 列出目录和文件(同上)
mkdir [foldname] -- 创建指定目录
rmdir [foldname] -- 删除指定目录
cd -- 切换目录
delete [filename] -- 删除文件
rename [filename] [newfilename] -- 重命名
close -- 关闭连接 但保留FTP命令参数提示
disconnect -- 关闭连接 但保留FTP命令参数提示(同上)
bye -- 结束连接
quit -- 结束连接
! -- 直接从远程Linux FTP进入到本地Shell中
exit -- (接上步)从本地Shell环境返回远程Linux FTP中
!ls -- 列出本地机器目录和文件
lcd [foldname] -- 更改本地工作目录
binary -- 使用二进制传输文件
prompt -- 切换提示(使用mput或mget上传下载多个文件时避免提示)
case -- 在使用mget时,将远程主机文件名的大写转换为小写字母
cdup -- 进入远程主机目录的父目录
system -- 显示远程主机的操作系统类型
hash -- 每传输1024字节,显示一个hash符号(#)
status -- 显示当前ftp状态
修改HOST name
$vi /etc/hostname
or $vi /etc/hosts
SUSE zypper install vsftp service
$ sudo zypper in vsftpd #install very secure FTP
$ sytemctl start vsftpd
$ systemctrl enable vsftpd
$ systemctl status vsftpd
Or $ sudo service vsftpd status
NTFS 格式硬盘无法挂载
Windows 硬盘连到 Linux 系统后,默认是无法识别的,可以通过 ntfs-3g 进行识别。
执行如下命令安装 ntfs-3g:
zypper in ntfs-3g
安装成功后通过如下命令进行挂载,结果如下:
mount -t ntfs-3g /dev/xvdb5 /mnt # 重新拔插Usb线后,可以自动识别。
链接:https://www.imooc.com/article/48394
VNC server setup
@ubantu How to Install and Configure VNC on Ubuntu 20.04
1. install vnc server
$ sudo apt update
$ sudo apt install tigervnc-standalone-server
$ sudo apt install tigervnc-standalone-server
$ vncpasswd #create password, not need sudo
$ sudo nano /etc/systemd/system/vncserver@.service # create vnc service
$ sudo systemctl daemon-reload #Reload systemd
$ sudo systemctl start vncserver@1.service
Start VNCSERVER
$vncserver
check vncmanager.service status
Normally there should be a config file:
List servers: vncserver -list
vncmanager operation
1. Start vncmanager
$systemctl enable vncmager.service
$systemctl start vncmanager.service
$ systemctl status vncmager.service #check status
2. Stop vncmager
$ systemctl stop vncmanager.service # stop service
$ systemctl disable vncmanager.service
$ systemctl status vncmanager.service
USE YAST2 to config vnc manager
How to Use the VNC to Remotely Log In to SUSE Linux
执行YAST2 里的Remote Administration 后会弹出下面的窗口,点击ok后,就没有动静了。
还需要执行如下命令:
网络设置
Yast2
需要选择Network Manager,否则无法选择DNS router 。。。
还能在右上角显示图标
命令行:在suse下networksetting
一、网络设置
设置IP、网关、DNS
- 设置IP
每个网卡都有一个配置文件,在/etc/sysconfig/network/目录下。用root登录,编辑ifcfg-eth0,就是你的网卡的物理地址的那个文件,不一定是eth0。
vim /etc/sysconfig/network/ifcfg-eth0
配置文件如下:
DEVICE=物理设备名
IPADDR=IP地址
NETMASK=掩码值
NETWORK=网络地址
BROADCAST=广播地址
GATEWAY=网关地址
ONBOOT=[yes|no](引导时是否激活设备)
USERCTL=[yes|no](非root用户是否可以控制该设备)
BOOTPROTO=[none|static|bootp|dhcp](引导时不使用协议|静态分配|BOOTP协议|DHCP协议)
HWADDR = 你的MAC地址
例如:
DEVICE=’eth0’
BOOTPROTO=’static’
IPADDR=’10.10.37.234’
NETMASTK=’255.255.255.0’
NETWORK=’10.10.37.0’
BROADCAST=’10.10.37.255’
ONBOOT=’yes’
- 设置网关
网关:实质上是一个网络通向其他网络的IP地址
设置默认网关命令:
vim /etc/sysconfig/network/,修改routes
GATEWAY =10.10.37.100
- 设置DNS
DNS域名解析系统(domain name system)
DNS服务器:由于IP地址不便于记忆,将域名解析成IP地址的服务器。
修改DNS的配置文件
vim /etc/resolv.conf
添加内容:nameserver10.10.1.2
也可继续添加:nameserver8.8.8.8
- 配置完成后,重启网络服务使之生效
service network restart
或者#/etc/init.d/network restart
二、解决出现的其他问题和补充
配置物理机时,一般一台物理机会有几块网卡,首先查看哪块网卡connected,然后在/etc/sysconfig/network/目录下,修改相应的网卡配置文件,比如ifcfg-eth0,eth2也可能,如果没有配置文件,新建配置文件,并添加内容。
配置网关时总是出问题,后来用yast解决了没有配置网关的问题,网关一定要设置对应网段的网关,一直是心中的痛。
集线器、交换机、路由器、网桥、网关的知识
参考了
http://www.cnblogs.com/imapla/archive/2013/03/12/2955931.html
集线器:
1)是放大信号,扩大网络的传输距离,是中继器的一种形式,区别在于集线器能够提供多端口服务,也称为多口中继器;
2)工作在物理层,分享带宽
交换机:
1) 有自己的CPU和RAM,可以实现存储转发
2) 工作在数据链路层,不共享带宽
网桥:
1) 将两个局域网连接起来,网桥在帧的转发过程中查看的地址是mac地址。
2) 工作在数据链路层
路由器:
1) 作为不同网络之间互相连接的枢纽,路由器系统构成了基于 TCP/IP 的国际互连网络 Internet
2) 工作在网络层
网关:网关(协议转换器)是互连网络中操作在OSI网络层之上的具有协议转换功能设施
传统的交换机只能分割冲突域,不能分割广播域;而路由器可以分割广播域
————————————————
版权声明:本文为CSDN博主「willinux」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/willinux20130812/article/details/24476251
1. Disk partition
You should be sure there is a partition (< 1G) mounted at /root/elf for boot up
And a partition mounted at / for data and OS
2. Question or warning
How Do You Install SUSE when You Encounter “The System cannot be installed because … There is no device mounted at ‘/'”?
Problem scenario
You are trying to install Linux SUSE. You get an error "The System cannot be installed because the following errors were found: There is no device mounted at '/'. How do you get passed this problem?
Solution
Use the "Expert Partitioner". Verify you have one device (e.g., /dev/sda1) that has the Type "BIOS Boot Partition." Verify you have one device (e.g., /dev/sda2) that has the Mount Point "/". You theoretically might be able to have one device have both traits.
If there is a device that is mounted to "/mnt", highlight it, go to Modify -> Edit Partition then go to the "Mount Point" and change it to "/". You may be prompted "Really skip formatting the partition?" Choose "Yes". Now try to resume the installation.
You may be prompted to abort the install or continue anyway to a variety of errors/questions. You may be able to just keep clicking "continue" through this series of prompts.
3. Set repository
1. Open yast via MobaXterm ssh
2. List of repositories
http://download.opensuse.org/tumbleweed/repo/non-oss/
http://download.opensuse.org/tumbleweed/repo/oss/
http://mirrors.ustc.edu.cn/opensuse/tumbleweed/repo/oss
opensuse | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
https://mirrors.tuna.tsinghua.edu.cn/help/opensuse/
sudo zypper ar-cfg'https://mirrors.tuna.tsinghua.edu.cn/opensuse/distribution/leap/$releasever/repo/oss/'tuna-osssudo
zypper ar-cfg'https://mirrors.tuna.tsinghua.edu.cn/opensuse/distribution/leap/$releasever/repo/non-oss/'tuna-non-osssudo
zypper ar-cfg'https://mirrors.tuna.tsinghua.edu.cn/opensuse/update/leap/$releasever/oss/'tuna-updatesudo
zypper ar-cfg'https://mirrors.tuna.tsinghua.edu.cn/opensuse/update/leap/$releasever/non-oss/'tuna-update-non-oss
3. reference from suse
How to set Tftp server in Windows: https://www.lifewire.com/definition-of-tftp-817576
4 Config SSH
$ssh-keygen #generate key
$ssh-copy-id -p 22 tester@192.167.1.14
Set config at local/.ssh
$touch config
Host aioc121
HostName 192.168.1.14
Port 22
User tester
IP config
Gateway 10.189.130.1
查看gateway:route -n
1. Disk partition
You should be sure there is a partition (< 1G) mounted at /root/elf for boot up
And a partition mounted at / for data and OS
2. Question or warning
How Do You Install SUSE when You Encounter “The System cannot be installed because … There is no device mounted at ‘/'”?
Problem scenario
You are trying to install Linux SUSE. You get an error "The System cannot be installed because the following errors were found: There is no device mounted at '/'. How do you get passed this problem?
Solution
Use the "Expert Partitioner". Verify you have one device (e.g., /dev/sda1) that has the Type "BIOS Boot Partition." Verify you have one device (e.g., /dev/sda2) that has the Mount Point "/". You theoretically might be able to have one device have both traits.
If there is a device that is mounted to "/mnt", highlight it, go to Modify -> Edit Partition then go to the "Mount Point" and change it to "/". You may be prompted "Really skip formatting the partition?" Choose "Yes". Now try to resume the installation.
You may be prompted to abort the install or continue anyway to a variety of errors/questions. You may be able to just keep clicking "continue" through this series of prompts.
3. Set repository
1. Open yast via MobaXterm ssh
2. List of repositories
http://download.opensuse.org/tumbleweed/repo/non-oss/
http://download.opensuse.org/tumbleweed/repo/oss/
http://mirrors.ustc.edu.cn/opensuse/tumbleweed/repo/oss
opensuse | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
https://mirrors.tuna.tsinghua.edu.cn/help/opensuse/
sudo zypper ar-cfg'https://mirrors.tuna.tsinghua.edu.cn/opensuse/distribution/leap/$releasever/repo/oss/'tuna-osssudo
zypper ar-cfg'https://mirrors.tuna.tsinghua.edu.cn/opensuse/distribution/leap/$releasever/repo/non-oss/'tuna-non-osssudo
zypper ar-cfg'https://mirrors.tuna.tsinghua.edu.cn/opensuse/update/leap/$releasever/oss/'tuna-updatesudo
zypper ar-cfg'https://mirrors.tuna.tsinghua.edu.cn/opensuse/update/leap/$releasever/non-oss/'tuna-update-non-oss
3. reference from suse
How to set Tftp server in Windows: https://www.lifewire.com/definition-of-tftp-817576
4 Config SSH
$ssh-keygen #generate key
$ssh-copy-id -p 22 tester@192.167.1.14
Set config at local/.ssh
$touch config
Host aioc121
HostName 192.168.1.14
Port 22
User tester
IP config
Gateway 10.189.130.1
查看gateway:route -n