阿里云ECS上CentOS系统配置从入门到进门
服务器端创建新用户
为服务器安全起见,创建用户(用户名:yishi):
useradd yishi
设置密码:
passwd yishi
添加sudo权限:
usermod -aG wheel yishi
关闭Root的远程访问
修改/etc/ssh/sshd_config
PermitRootLogin no
然后:
service sshd restart
开启SSH的公钥访问
$ cat id_rsa.pub >> ~/.ssh/authorized_keys$ chmod 700 ~/.ssh$ chmod 600 ~/.ssh/id_rsa # Disable password authentication forcing use of keysPasswordAuthentication no
https://wiki.centos.org/HowTo...
MongoDB
Create/etc/yum.repos.d/mongodb-org-3.2.repo,Content:
[mongodb-org-3.2]name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc
Client only:
sudo yum install -y mongodb-org-shell
https://docs.mongodb.com/manu...
语言报错的处理
export LC_ALL=Cmongo
http://askubuntu.com/question...
NodeJS连接阿里云MongoDB数据库
dbURI = sprintf("mongodb://%s:%s@%s:%d,%s:%d/%s?replicaSet=%s", conf.username, conf.password, conf.host1, conf.port1, conf.host2, conf.port2, conf.dbname, conf.replSetName);
随机密码-MAC上
openssl rand -hex 16
关键字:CentOS, linux
版权声明
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处。如若内容有涉嫌抄袭侵权/违法违规/事实不符,请点击 举报 进行投诉反馈!