ubuntu ssh

来源:互联网 发布:网络验证源码 编辑:程序博客网 时间:2024/05/22 09:48

1.ssh 远程链接:

  • Linux terminal( linux 终端)下
 ssh user@xx.xx   pass:xxx
  • 文件夹下->链接到服务器
服务器地址:ssh://username@servername.example.com/folder

2.新建用户

使用管理员账号登陆系统,建立用户tmp_3452 密码3sdt5:Eawhg

添加用户命令:
代码如下 复制代码

[root@ptr228 ~]# adduser tmp_3452修改密码命令:[root@ptr228 ~]# passwd tmp_3452

3.xxx is not in the sudoers file.This incident will be reported.的解决方法

1.切换到root用户下,怎么切换就不用说了吧,不会的自己百度去.

sudo -i

2.添加sudo文件的写权限,命令是:

chmod u+w /etc/sudoers

3.编辑sudoers文件

vi /etc/sudoers

找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)

ps:这里说下你可以sudoers添加下面四行中任意一条youuser            ALL=(ALL)                ALL%youuser           ALL=(ALL)                ALLyouuser            ALL=(ALL)                NOPASSWD: ALL%youuser           ALL=(ALL)                NOPASSWD: ALL

第一行:允许用户youuser执行sudo命令(需要输入密码).
第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码).
第三行:允许用户youuser执行sudo命令,并且在执行的时候不输入密码.
第四行:允许用户组youuser里面的用户执行sudo命令,并且在执行的时候不输入密码.

4.撤销sudoers文件写权限,命令:

chmod u-w /etc/sudoers

这样普通用户就可以使用sudo了

4.ubuntu用sudo su进入root权限后如何退出? 即如何把#变成$

exit
logout
ctrl D
或者重新登录

5.【linux】su、sudo、sudo su、sudo -i的用法和区别

sudo : 暂时切换到超级用户模式以执行超级用户权限,提示输入密码时该密码为当前用户的密码,而不是超级账户的密码。不过有时间限制,Ubuntu默认为一次时长15分钟。

su 账户名称: 切换到某某用户模式,提示输入密码时该密码为切换后账户的密码,用法为“su 账户名称”。如果后面不加账户时系统默认为root账户,密码也为超级账户的密码。没有时间限制。

sudo -i: 为了频繁的执行某些只有超级用户才能执行的权限,而不用每次输入密码,可以使用该命令。提示输入密码时该密码为当前账户的密码。没有时间限制。执行该命令后提示符变为“#”而不是“$”。想退回普通账户时可以执行“exit”或“logout” 。

sudo -i 直接运行sudo命令加-i参数sudo su 运行sudo命令给su命令提权,运行su命令。sudo -i 运行结果 PWD=/rootsudo su 运行结果 PWD=/home/用户名(当前用户主目录)

6.Install Anaconda on Ubuntu 12.04 via command line

ust download the anaconda installer and execute it as it is a shell script. Follow the steps :

In the terminal type "wget https://repo.continuum.io/archive/Anaconda-2.3.0-Linux-x86_64.sh"The file will be downloaded in current directory. Now execute the downloaded file by "bash ./Anaconda-2.3.0-Linux-x86_64.sh"Restart the terminal. This is very important for python version provided by anaconda to be set to default for that user.

Note- Try using environment for using different version of python. Changing the default python version for root might result in non functioning of some functionalities like yum.

7.安装tensorflow

极客学院中文安装教程:http://wiki.jikexueyuan.com/project/tensorflow-zh/get_started/os_setup.html
英文安装教程:https://www.tensorflow.org/get_started/
清华源:https://mirrors.tuna.tsinghua.edu.cn/help/tensorflow/

测试

$ python>>> import tensorflow as tf>>> hello = tf.constant('Hello, TensorFlow!')>>> sess = tf.Session()>>> print sess.run(hello)Hello, TensorFlow!>>> a = tf.constant(10)>>> b = tf.constant(32)>>> print sess.run(a+b)42

建议

(1)退出Python环境,Ctrl+D或者输入quit

(2)不用TF时关闭环境

$ source deactivate

(3)使用时激活

source activate tensorflow

8.安装git

使用这个就行:http://blog.csdn.net/weixin_37251044/article/details/78228456

其中会遇到:

neu105@TitanX:~$ ssh-add -lCould not open a connection to your authentication agent.

这里要加一句:

neu105@TitanX:~$ ssh-agent bash

然后接着:

neu105@TitanX:~$ ssh-add -lThe agent has no identities.neu105@TitanX:~$ ssh-add ~/.ssh/github_rsaEnter passphrase for /home/neu105/.ssh/github_rsa: Identity added: /home/neu105/.ssh/github_rsa (/home/neu105/.ssh/github_rsa)neu105@TitanX:~$ ssh-add -l2048 SHA256:qBFaGob1cHcVjIzIO/rnRPJfyO5+ckFx0/ymJkwr0Hs /home/neu105/.ssh/github_rsa (RSA)

9.如何复制粘贴vi的代码

我在 ~/.vimrc 中添加了这两行
vnoremap “+y
nnoremap “+p
然后就可以按v在visual模式下用光标选中内容 ctrl+c 复制到系统剪切版了。。。
粘贴也可以在normal下按 ctrl+v 完成

10.linux获取cpu使用率

top

11.linux查看ip:

ifconfig -a